mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Cancel action if new situation arises
Lot of actions are liable to deadlock if this is not done
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user