From 2fddd8ca0ae5504052cab65768f37743728d3ab1 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Fri, 3 Jul 2026 14:14:13 +0700 Subject: [PATCH] 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 --- regamedll/dlls/hostage/hostage.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/regamedll/dlls/hostage/hostage.cpp b/regamedll/dlls/hostage/hostage.cpp index c6f57091c..666b04078 100644 --- a/regamedll/dlls/hostage/hostage.cpp +++ b/regamedll/dlls/hostage/hostage.cpp @@ -1450,6 +1450,11 @@ void CHostageManager::ServerActivate() #ifdef REGAMEDLL_ADD if (!AreRunningCZero()) { + // Free stale navigation data of the previous map, + // CCSBotManager::LoadNavigationMap does this only when bots are allowed + if (!AreBotsAllowed()) + DestroyNavigationMap(); + LoadNavigationMap(); } #endif