mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-21 06:14:05 +00:00
Fix switch from invalid navmesh number to valid
This commit is contained in:
parent
80051db8f8
commit
84fbb486d3
1 changed files with 6 additions and 2 deletions
|
@ -34,7 +34,7 @@ namespace MWRender
|
||||||
void NavMesh::update(const dtNavMesh& navMesh, const std::size_t id,
|
void NavMesh::update(const dtNavMesh& navMesh, const std::size_t id,
|
||||||
const std::size_t generation, const std::size_t revision, const DetourNavigator::Settings& settings)
|
const std::size_t generation, const std::size_t revision, const DetourNavigator::Settings& settings)
|
||||||
{
|
{
|
||||||
if (!mEnabled || (mId == id && mGeneration >= generation && mRevision >= revision))
|
if (!mEnabled || (mGroup && mId == id && mGeneration >= generation && mRevision >= revision))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mId = id;
|
mId = id;
|
||||||
|
@ -53,7 +53,10 @@ namespace MWRender
|
||||||
void NavMesh::reset()
|
void NavMesh::reset()
|
||||||
{
|
{
|
||||||
if (mGroup)
|
if (mGroup)
|
||||||
|
{
|
||||||
mRootNode->removeChild(mGroup);
|
mRootNode->removeChild(mGroup);
|
||||||
|
mGroup = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavMesh::enable()
|
void NavMesh::enable()
|
||||||
|
@ -65,7 +68,8 @@ namespace MWRender
|
||||||
|
|
||||||
void NavMesh::disable()
|
void NavMesh::disable()
|
||||||
{
|
{
|
||||||
reset();
|
if (mGroup)
|
||||||
|
mRootNode->removeChild(mGroup);
|
||||||
mEnabled = false;
|
mEnabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue