mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 12:09:41 +00:00
Fix 'part has no parent' warning caused by destructing in the wrong order
This commit is contained in:
parent
a55604c549
commit
afa39d121f
1 changed files with 2 additions and 4 deletions
|
@ -269,6 +269,7 @@ const NpcAnimation::PartBoneMap NpcAnimation::sPartList = createPartListMap();
|
|||
|
||||
NpcAnimation::~NpcAnimation()
|
||||
{
|
||||
mAmmunition.reset();
|
||||
}
|
||||
|
||||
NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, osg::ref_ptr<osg::Group> parentNode, Resource::ResourceSystem* resourceSystem,
|
||||
|
@ -880,6 +881,7 @@ void NpcAnimation::addControllers()
|
|||
void NpcAnimation::showWeapons(bool showWeapon)
|
||||
{
|
||||
mShowWeapons = showWeapon;
|
||||
mAmmunition.reset();
|
||||
if(showWeapon)
|
||||
{
|
||||
MWWorld::InventoryStore& inv = mPtr.getClass().getInventoryStore(mPtr);
|
||||
|
@ -898,11 +900,7 @@ void NpcAnimation::showWeapons(bool showWeapon)
|
|||
MWWorld::ContainerStoreIterator ammo = inv.getSlot(MWWorld::InventoryStore::Slot_Ammunition);
|
||||
if (ammo != inv.end() && ammo->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::Bolt)
|
||||
attachArrow();
|
||||
else
|
||||
mAmmunition.reset();
|
||||
}
|
||||
else
|
||||
mAmmunition.reset();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue