From f646bc2bfa636fc0d9ee5f2302070b5d94d44977 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Sun, 4 Feb 2024 16:14:01 +0200 Subject: [PATCH] Set correct next action if npc has no AP With aiData.bAction = AI_ACTION_NONE and aiData.bNextAction = AI_ACTION_END_TURN, the npc turn is correctly ended in the next call to TurnBasedHandleNPCAI() --- TacticalAI/DecideAction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index d8205b121..1a0de48c8 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -2493,6 +2493,7 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier) if ( pSoldier->bActionPoints <= 0 ) //Action points can be negative { pSoldier->aiData.usActionData = NOWHERE; + pSoldier->aiData.bNextAction = AI_ACTION_END_TURN; return(AI_ACTION_NONE); } @@ -5118,6 +5119,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier) if (pSoldier->bActionPoints <= 0) { pSoldier->aiData.usActionData = NOWHERE; + pSoldier->aiData.bNextAction = AI_ACTION_END_TURN; return(AI_ACTION_NONE); }