Cancel action if new situation arises

Lot of actions are liable to deadlock if this is not done
This commit is contained in:
Asdow
2024-02-11 13:32:17 +02:00
parent 67a26e0936
commit dfc17c68c6
+1 -1
View File
@@ -776,7 +776,7 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier ) // FIXME - this function is named
// Prevent AI deadlocking in case enemy is performing an action and player gets an interrupt.
// Without this, if player doesn't move any mercs, the AI soldier will wait until the deadlock is broken.
// By canceling the AI action, the AI can then reconsider actions.
if (pSoldier->aiData.bAction == AI_ACTION_FIRE_GUN || pSoldier->aiData.bAction == AI_ACTION_KNIFE_MOVE || pSoldier->aiData.bAction == AI_ACTION_STEAL_MOVE)
//if (pSoldier->aiData.bAction == AI_ACTION_FIRE_GUN || pSoldier->aiData.bAction == AI_ACTION_KNIFE_MOVE || pSoldier->aiData.bAction == AI_ACTION_STEAL_MOVE || pSoldier->aiData.bAction == AI_ACTION_KNIFE_STAB)
{
DebugAI(AI_MSG_INFO, pSoldier, String("New Situation"));
CancelAIAction(pSoldier, FALSE);