Skip to content

Commit 2fddd8c

Browse files
belomaxorkaclaude
andcommitted
Fix improved hostages AI freezing after map change when bots are disabled
When hostage_ai_enable is set in CS 1.6 but bots are not allowed (dedicated server without bot_enable), CCSBotManager::LoadNavigationMap returns early and never frees the navigation mesh of the previous map. LoadNavigationMap() then sees a non-empty TheNavAreaList and keeps the stale nav data, so on the next hostage map CHostageImprov is created against the wrong navigation mesh: hostages freeze and stop responding to +use. Destroy the stale navigation data in CHostageManager::ServerActivate before loading, but only when bots are not allowed - otherwise CCSBotManager has already reloaded the nav mesh earlier in the same ServerActivate and holds pointers into it. Fixes #1161 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 781a68a commit 2fddd8c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

regamedll/dlls/hostage/hostage.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,11 @@ void CHostageManager::ServerActivate()
14501450

14511451
#ifdef REGAMEDLL_ADD
14521452
if (!AreRunningCZero()) {
1453+
// Free stale navigation data of the previous map,
1454+
// CCSBotManager::LoadNavigationMap does this only when bots are allowed
1455+
if (!AreBotsAllowed())
1456+
DestroyNavigationMap();
1457+
14531458
LoadNavigationMap();
14541459
}
14551460
#endif

0 commit comments

Comments
 (0)