From 70c7dffa01b9a56a7ece8dad09e0c5b48f776a83 Mon Sep 17 00:00:00 2001 From: Alan Shen Date: Thu, 11 Dec 2025 01:12:41 -0700 Subject: [PATCH] Fix: Bot didn't have plan when repathing Sometimes a bot doesn't have a path plan when the repathing code triggers around a friendly which leads to an access error. --- src/game/server/neo/bot/neo_bot.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/game/server/neo/bot/neo_bot.cpp b/src/game/server/neo/bot/neo_bot.cpp index 8390df1cf8..9a8dae1649 100644 --- a/src/game/server/neo/bot/neo_bot.cpp +++ b/src/game/server/neo/bot/neo_bot.cpp @@ -1915,6 +1915,12 @@ void CNEOBot::RepathIfFriendlyBlockingLineOfFire() return; } + const PathFollower* pPath = GetCurrentPath(); + if (!pPath) + { + return; + } + if (!m_repathAroundFriendlyTimer.IsElapsed()) { return; @@ -1932,7 +1938,6 @@ void CNEOBot::RepathIfFriendlyBlockingLineOfFire() if (!IsLineOfFireClearOfFriendlies(eyePos, targetPos)) { - const PathFollower* pPath = GetCurrentPath(); Vector goal = pPath->GetEndPosition(); CNEOBotPathCost cost(this, SAFEST_ROUTE);