diff --git a/doc/site/content/changelogs/changelog-2026-07.markdown b/doc/site/content/changelogs/changelog-2026-07.markdown index a12976ea753..048d19ce7be 100644 --- a/doc/site/content/changelogs/changelog-2026-07.markdown +++ b/doc/site/content/changelogs/changelog-2026-07.markdown @@ -115,3 +115,4 @@ Added a bunch of `debug.emulateFoo` functions that emulate input. Useful for aut - fix Skirmish AI API compilation issues due to `AIFloat3` having a non-trivial constructor. - attempt to fix the lack of `wupget:GameProgress` calls when initially catching up. - fix Lua `VBO::CopyTo` to copy VBO data CPU side in additon to GPU side. Formerly it only copied data GPU side. +- fix QTPFS path cleanup when an immediate path search fails diff --git a/rts/Sim/Path/QTPFS/PathManager.cpp b/rts/Sim/Path/QTPFS/PathManager.cpp index 247a277049c..b971d9c194b 100644 --- a/rts/Sim/Path/QTPFS/PathManager.cpp +++ b/rts/Sim/Path/QTPFS/PathManager.cpp @@ -1686,13 +1686,16 @@ unsigned int QTPFS::PathManager::ExecuteImmediateSearch(unsigned int pathId){ registry.remove(pathEntity); registry.remove(pathEntity); } else { - DeletePathEntity(pathEntity); pathId = 0; } } } - RemovePathSearch(pathEntity); + // If successful, just remove the path search, otherwise delete the path entity and its search. + if (pathId > 0) + RemovePathSearch(pathEntity); + else + DeletePathEntity(pathEntity); return pathId; }