mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-27 01:41:34 +00:00
Use "setObjectRoot" in esm4npcanimation.cpp
This commit is contained in:
parent
4beed29404
commit
1acac873cf
1 changed files with 5 additions and 2 deletions
|
@ -22,13 +22,16 @@ namespace MWRender
|
||||||
const MWWorld::Ptr& ptr, osg::ref_ptr<osg::Group> parentNode, Resource::ResourceSystem* resourceSystem)
|
const MWWorld::Ptr& ptr, osg::ref_ptr<osg::Group> parentNode, Resource::ResourceSystem* resourceSystem)
|
||||||
: Animation(ptr, std::move(parentNode), resourceSystem)
|
: Animation(ptr, std::move(parentNode), resourceSystem)
|
||||||
{
|
{
|
||||||
getOrCreateObjectRoot();
|
std::string smodel
|
||||||
|
= Misc::ResourceHelpers::correctMeshPath(mPtr.getClass().getModel(mPtr), mResourceSystem->getVFS());
|
||||||
|
setObjectRoot(smodel, true, true, false);
|
||||||
updateParts();
|
updateParts();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ESM4NpcAnimation::updateParts()
|
void ESM4NpcAnimation::updateParts()
|
||||||
{
|
{
|
||||||
mObjectRoot->removeChildren(0, mObjectRoot->getNumChildren());
|
if (!mObjectRoot.get())
|
||||||
|
return;
|
||||||
const ESM4::Npc* traits = MWClass::ESM4Npc::getTraitsRecord(mPtr);
|
const ESM4::Npc* traits = MWClass::ESM4Npc::getTraitsRecord(mPtr);
|
||||||
// There is no flag "mIsTES5", so we can not distinguish from other cases.
|
// There is no flag "mIsTES5", so we can not distinguish from other cases.
|
||||||
// But calling wrong `updateParts*` function shouldn't crash the game and will
|
// But calling wrong `updateParts*` function shouldn't crash the game and will
|
||||||
|
|
Loading…
Reference in a new issue