mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 09:23:53 +00:00
Remove parts before setting the new object root
This commit is contained in:
parent
0df975a4d7
commit
0fc65db6bb
2 changed files with 5 additions and 2 deletions
|
@ -1457,6 +1457,9 @@ namespace MWRender
|
||||||
|
|
||||||
PartHolder::~PartHolder()
|
PartHolder::~PartHolder()
|
||||||
{
|
{
|
||||||
|
if (mNode.get() && !mNode->getNumParents())
|
||||||
|
std::cerr << "Warning: part has no parents " << std::endl;
|
||||||
|
|
||||||
if (mNode.get() && mNode->getNumParents())
|
if (mNode.get() && mNode->getNumParents())
|
||||||
{
|
{
|
||||||
if (mNode->getNumParents() > 1)
|
if (mNode->getNumParents() > 1)
|
||||||
|
|
|
@ -422,6 +422,8 @@ int NpcAnimation::getSlot(const osg::NodePath &path) const
|
||||||
void NpcAnimation::updateNpcBase()
|
void NpcAnimation::updateNpcBase()
|
||||||
{
|
{
|
||||||
clearAnimSources();
|
clearAnimSources();
|
||||||
|
for(size_t i = 0;i < ESM::PRT_Count;i++)
|
||||||
|
removeIndividualPart((ESM::PartReferenceType)i);
|
||||||
|
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Race *race = store.get<ESM::Race>().find(mNpc->mRace);
|
const ESM::Race *race = store.get<ESM::Race>().find(mNpc->mRace);
|
||||||
|
@ -501,8 +503,6 @@ void NpcAnimation::updateNpcBase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(size_t i = 0;i < ESM::PRT_Count;i++)
|
|
||||||
removeIndividualPart((ESM::PartReferenceType)i);
|
|
||||||
updateParts();
|
updateParts();
|
||||||
|
|
||||||
mWeaponAnimationTime->updateStartTime();
|
mWeaponAnimationTime->updateStartTime();
|
||||||
|
|
Loading…
Reference in a new issue