From 138ad0656fa21a1004e57510818f7e86b20c1ec8 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Sat, 19 Aug 2023 14:37:49 +0300 Subject: [PATCH] Prevent AI deadlocks Canceling current AI actions at the start of soldier's turn prevents a lot of ai deadlocks. The status RED & BLACK actions are supposed re-evaluate the situation every turn anyways --- TacticalAI/AIMain.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/TacticalAI/AIMain.cpp b/TacticalAI/AIMain.cpp index b64067a8..b2eca435 100644 --- a/TacticalAI/AIMain.cpp +++ b/TacticalAI/AIMain.cpp @@ -1817,6 +1817,7 @@ void RefreshAI(SOLDIERTYPE *pSoldier) if ((pSoldier->aiData.bAlertStatus == STATUS_BLACK) || (pSoldier->aiData.bAlertStatus == STATUS_RED)) { // always freshly rethink things at start of his turn + CancelAIAction(pSoldier, FALSE); pSoldier->aiData.bNewSituation = IS_NEW_SITUATION; } else