mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-17 12:39:40 +00:00
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
apps/openmw/mwrender
|
@ -361,6 +361,8 @@ void NpcAnimation::updateParts()
|
|||
};
|
||||
static const size_t slotlistsize = sizeof(slotlist)/sizeof(slotlist[0]);
|
||||
|
||||
bool wasArrowAttached = (mAmmunition.get());
|
||||
|
||||
MWWorld::InventoryStore& inv = mPtr.getClass().getInventoryStore(mPtr);
|
||||
for(size_t i = 0;i < slotlistsize && mViewMode != VM_HeadOnly;i++)
|
||||
{
|
||||
|
@ -555,6 +557,9 @@ void NpcAnimation::updateParts()
|
|||
"meshes\\"+bodypart->mModel);
|
||||
}
|
||||
}
|
||||
|
||||
if (wasArrowAttached)
|
||||
attachArrow();
|
||||
}
|
||||
|
||||
void NpcAnimation::addFirstPersonOffset(const Ogre::Vector3 &offset)
|
||||
|
|
|
@ -49,6 +49,8 @@ void WeaponAnimation::attachArrow(MWWorld::Ptr actor)
|
|||
else
|
||||
{
|
||||
NifOgre::ObjectScenePtr weapon = getWeapon();
|
||||
if (!weapon.get())
|
||||
return;
|
||||
|
||||
MWWorld::ContainerStoreIterator ammo = inv.getSlot(MWWorld::InventoryStore::Slot_Ammunition);
|
||||
if (ammo == inv.end())
|
||||
|
@ -66,6 +68,9 @@ void WeaponAnimation::attachArrow(MWWorld::Ptr actor)
|
|||
|
||||
void WeaponAnimation::releaseArrow(MWWorld::Ptr actor)
|
||||
{
|
||||
if (!mAmmunition.get())
|
||||
return;
|
||||
|
||||
MWWorld::InventoryStore& inv = actor.getClass().getInventoryStore(actor);
|
||||
MWWorld::ContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||
if (weapon == inv.end())
|
||||
|
|
Loading…
Reference in a new issue