diff --git a/apps/openmw/mwrender/navmesh.hpp b/apps/openmw/mwrender/navmesh.hpp index 29205ca27..d329b895d 100644 --- a/apps/openmw/mwrender/navmesh.hpp +++ b/apps/openmw/mwrender/navmesh.hpp @@ -30,6 +30,11 @@ namespace MWRender void disable(); + bool isEnabled() const + { + return mEnabled; + } + private: osg::ref_ptr mRootNode; bool mEnabled; diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 693491efe..322c310a2 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1385,6 +1385,9 @@ namespace MWRender void RenderingManager::updateNavMesh() { + if (!mNavMesh->isEnabled()) + return; + const auto navMeshes = mNavigator.getNavMeshes(); auto it = navMeshes.begin();