From 6d04d7ff83f7385a82e05d4ac854c75d6c11310f Mon Sep 17 00:00:00 2001 From: namreeb Date: Wed, 24 Jul 2024 14:45:37 -1000 Subject: [PATCH] Fixed viewer crash when pathfinding fails --- MapViewer/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MapViewer/main.cpp b/MapViewer/main.cpp index 8dcd37f..5c916e2 100644 --- a/MapViewer/main.cpp +++ b/MapViewer/main.cpp @@ -292,8 +292,11 @@ LRESULT CALLBACK GuiWindowProc(HWND hWnd, UINT message, WPARAM wParam, if (gNavMesh->FindPath(gStart, hit, path, false)) gRenderer->AddPath(path); else + { MessageBox(nullptr, "FindPath failed", "Path Find", 0); + return TRUE; + } auto const& prev_hop = path[path.size() - 2]; float height;