mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: fix navmesh query crash regression
Caused in commit ce4d4aa59831fbb6a2b7c32820561b321484dc56. Need to properly free and set the navmesh pointer.
This commit is contained in:
parent
73d0e81983
commit
034c0f07d4
@ -544,6 +544,9 @@ void Editor::selectNavMeshType(const NavMeshType_e navMeshType)
|
||||
|
||||
bool Editor::loadAll(std::string path, const bool fullPath)
|
||||
{
|
||||
dtFreeNavMesh(m_navMesh);
|
||||
m_navMesh = nullptr;
|
||||
|
||||
const char* navMeshPath = nullptr;
|
||||
char buffer[256];
|
||||
|
||||
|
@ -404,7 +404,6 @@ void Editor_StaticTileMeshCommon::renderIntermediateTileMeshOptions()
|
||||
|
||||
if (ImGui::Button("Load", ImVec2(123, 0)))
|
||||
{
|
||||
dtFreeNavMesh(m_navMesh);
|
||||
Editor::loadAll(m_modelName.c_str());
|
||||
m_navQuery->init(m_navMesh, 2048);
|
||||
|
||||
|
@ -833,7 +833,6 @@ void Editor_TempObstacles::handleSettings()
|
||||
|
||||
if (ImGui::Button("Load", ImVec2(123, 0)))
|
||||
{
|
||||
dtFreeNavMesh(m_navMesh);
|
||||
Editor::loadAll(m_modelName.c_str());
|
||||
m_navQuery->init(m_navMesh, 2048);
|
||||
|
||||
|
@ -1026,6 +1026,7 @@ int not_main(int argc, char** argv)
|
||||
if (GetOpenFileNameA(&diag))
|
||||
{
|
||||
editor->loadAll(szFile, true);
|
||||
editor->getNavMeshQuery()->init(editor->getNavMesh(), 2048);
|
||||
}
|
||||
}
|
||||
if (ImGui::Button(meshName.empty() ? "Choose Level..." : meshName.c_str()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user