mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-03 23:36:59 -04:00
Fix 'part has no parent' warning caused by destructing in the wrong order
This commit is contained in:
parent
a55604c549
commit
afa39d121f
@ -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…
x
Reference in New Issue
Block a user