mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
Use enchanted glow for pulled arrows
This commit is contained in:
parent
4c92f0c4e1
commit
1eed511b4e
@ -173,6 +173,16 @@ bool CreatureWeaponAnimation::isArrowAttached() const
|
|||||||
void CreatureWeaponAnimation::attachArrow()
|
void CreatureWeaponAnimation::attachArrow()
|
||||||
{
|
{
|
||||||
WeaponAnimation::attachArrow(mPtr);
|
WeaponAnimation::attachArrow(mPtr);
|
||||||
|
|
||||||
|
const MWWorld::InventoryStore& inv = mPtr.getClass().getInventoryStore(mPtr);
|
||||||
|
MWWorld::ConstContainerStoreIterator ammo = inv.getSlot(MWWorld::InventoryStore::Slot_Ammunition);
|
||||||
|
if (ammo != inv.end() && !ammo->getClass().getEnchantment(*ammo).empty())
|
||||||
|
{
|
||||||
|
osg::Group* bone = getArrowBone();
|
||||||
|
if (bone != nullptr && bone->getNumChildren())
|
||||||
|
addGlow(bone->getChild(0), ammo->getClass().getEnchantmentColor(*ammo));
|
||||||
|
}
|
||||||
|
|
||||||
updateQuiver();
|
updateQuiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -947,6 +947,16 @@ void NpcAnimation::showCarriedLeft(bool show)
|
|||||||
void NpcAnimation::attachArrow()
|
void NpcAnimation::attachArrow()
|
||||||
{
|
{
|
||||||
WeaponAnimation::attachArrow(mPtr);
|
WeaponAnimation::attachArrow(mPtr);
|
||||||
|
|
||||||
|
const MWWorld::InventoryStore& inv = mPtr.getClass().getInventoryStore(mPtr);
|
||||||
|
MWWorld::ConstContainerStoreIterator ammo = inv.getSlot(MWWorld::InventoryStore::Slot_Ammunition);
|
||||||
|
if (ammo != inv.end() && !ammo->getClass().getEnchantment(*ammo).empty())
|
||||||
|
{
|
||||||
|
osg::Group* bone = getArrowBone();
|
||||||
|
if (bone != nullptr && bone->getNumChildren())
|
||||||
|
addGlow(bone->getChild(0), ammo->getClass().getEnchantmentColor(*ammo));
|
||||||
|
}
|
||||||
|
|
||||||
updateQuiver();
|
updateQuiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user