forked from teamnwah/openmw-tes3coop
Fix equipment update removing ammunition (Fixes #2144)
This commit is contained in:
parent
18fb3f831a
commit
9c693d078b
2 changed files with 10 additions and 0 deletions
|
@ -361,6 +361,8 @@ void NpcAnimation::updateParts()
|
||||||
};
|
};
|
||||||
static const size_t slotlistsize = sizeof(slotlist)/sizeof(slotlist[0]);
|
static const size_t slotlistsize = sizeof(slotlist)/sizeof(slotlist[0]);
|
||||||
|
|
||||||
|
bool wasArrowAttached = (mAmmunition.get());
|
||||||
|
|
||||||
MWWorld::InventoryStore& inv = mPtr.getClass().getInventoryStore(mPtr);
|
MWWorld::InventoryStore& inv = mPtr.getClass().getInventoryStore(mPtr);
|
||||||
for(size_t i = 0;i < slotlistsize && mViewMode != VM_HeadOnly;i++)
|
for(size_t i = 0;i < slotlistsize && mViewMode != VM_HeadOnly;i++)
|
||||||
{
|
{
|
||||||
|
@ -555,6 +557,9 @@ void NpcAnimation::updateParts()
|
||||||
"meshes\\"+bodypart->mModel);
|
"meshes\\"+bodypart->mModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wasArrowAttached)
|
||||||
|
attachArrow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NpcAnimation::addFirstPersonOffset(const Ogre::Vector3 &offset)
|
void NpcAnimation::addFirstPersonOffset(const Ogre::Vector3 &offset)
|
||||||
|
|
|
@ -49,6 +49,8 @@ void WeaponAnimation::attachArrow(MWWorld::Ptr actor)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NifOgre::ObjectScenePtr weapon = getWeapon();
|
NifOgre::ObjectScenePtr weapon = getWeapon();
|
||||||
|
if (!weapon.get())
|
||||||
|
return;
|
||||||
|
|
||||||
MWWorld::ContainerStoreIterator ammo = inv.getSlot(MWWorld::InventoryStore::Slot_Ammunition);
|
MWWorld::ContainerStoreIterator ammo = inv.getSlot(MWWorld::InventoryStore::Slot_Ammunition);
|
||||||
if (ammo == inv.end())
|
if (ammo == inv.end())
|
||||||
|
@ -66,6 +68,9 @@ void WeaponAnimation::attachArrow(MWWorld::Ptr actor)
|
||||||
|
|
||||||
void WeaponAnimation::releaseArrow(MWWorld::Ptr actor)
|
void WeaponAnimation::releaseArrow(MWWorld::Ptr actor)
|
||||||
{
|
{
|
||||||
|
if (!mAmmunition.get())
|
||||||
|
return;
|
||||||
|
|
||||||
MWWorld::InventoryStore& inv = actor.getClass().getInventoryStore(actor);
|
MWWorld::InventoryStore& inv = actor.getClass().getInventoryStore(actor);
|
||||||
MWWorld::ContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
MWWorld::ContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
if (weapon == inv.end())
|
if (weapon == inv.end())
|
||||||
|
|
Loading…
Reference in a new issue