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:
parent
3232faa703
commit
08dcbe30b3
1 changed files with 5 additions and 8 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue