1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 16:15:31 +00:00

Earlier nullptr check

This commit is contained in:
Nelsson Huotari 2020-11-20 19:46:08 +02:00
parent 3232faa703
commit 08dcbe30b3

View file

@ -23,12 +23,6 @@ namespace OsgAOpenMW
{ {
if (node.libraryName() == std::string("osgAnimation") && node.className() == std::string("Bone") && node.getName() == std::string("root")) if (node.libraryName() == std::string("osgAnimation") && node.className() == std::string("Bone") && node.getName() == std::string("root"))
{ {
if (!mAnimationManager)
{
traverse(node);
return;
}
osg::ref_ptr<OsgaController::KeyframeController> callback = new OsgaController::KeyframeController(); osg::ref_ptr<OsgaController::KeyframeController> callback = new OsgaController::KeyframeController();
std::vector<OsgaController::EmulatedAnimation> emulatedAnimations; std::vector<OsgaController::EmulatedAnimation> emulatedAnimations;
@ -125,8 +119,11 @@ namespace Resource
{ {
osg::ref_ptr<osg::Node> scene = const_cast<osg::Node*> ( mSceneManager->getTemplate(normalized).get() ); osg::ref_ptr<osg::Node> scene = const_cast<osg::Node*> ( mSceneManager->getTemplate(normalized).get() );
osg::ref_ptr<osgAnimation::BasicAnimationManager> bam = dynamic_cast<osgAnimation::BasicAnimationManager*> (scene->getUpdateCallback()); osg::ref_ptr<osgAnimation::BasicAnimationManager> bam = dynamic_cast<osgAnimation::BasicAnimationManager*> (scene->getUpdateCallback());
OsgAOpenMW::RetrieveAnimationsVisitor rav(*loaded.get(), bam); if (bam)
scene->accept(rav); {
OsgAOpenMW::RetrieveAnimationsVisitor rav(*loaded.get(), bam);
scene->accept(rav);
}
} }
mCache->addEntryToObjectCache(normalized, loaded); mCache->addEntryToObjectCache(normalized, loaded);
return loaded; return loaded;