forked from mirror/openmw-tes3mp
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()
|
NpcAnimation::~NpcAnimation()
|
||||||
{
|
{
|
||||||
|
mAmmunition.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, osg::ref_ptr<osg::Group> parentNode, Resource::ResourceSystem* resourceSystem,
|
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)
|
void NpcAnimation::showWeapons(bool showWeapon)
|
||||||
{
|
{
|
||||||
mShowWeapons = showWeapon;
|
mShowWeapons = showWeapon;
|
||||||
|
mAmmunition.reset();
|
||||||
if(showWeapon)
|
if(showWeapon)
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore& inv = mPtr.getClass().getInventoryStore(mPtr);
|
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);
|
MWWorld::ContainerStoreIterator ammo = inv.getSlot(MWWorld::InventoryStore::Slot_Ammunition);
|
||||||
if (ammo != inv.end() && ammo->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::Bolt)
|
if (ammo != inv.end() && ammo->get<ESM::Weapon>()->mBase->mData.mType == ESM::Weapon::Bolt)
|
||||||
attachArrow();
|
attachArrow();
|
||||||
else
|
|
||||||
mAmmunition.reset();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
mAmmunition.reset();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue