From 43ab995ecdd0fb9d494f33d8a81396d90526204b Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Fri, 16 Oct 2020 20:44:21 +0000 Subject: [PATCH] Only show "suppression fire" message if target soldier cannot be seen after turning. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8903 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- TacticalAI/DecideAction.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index 1777ee15..e9265d1d 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -3113,14 +3113,21 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier) pSoldier->aiData.usActionData = BestShot.ubStance; DebugAI(AI_MSG_INFO, pSoldier, String("Change stance before shooting")); - ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_SUPPRESSIONFIRE]); + + // show "suppression fire" message only if opponent cannot be seen after turning + if (!LOS_Raised(pSoldier, MercPtrs[BestShot.ubOpponent], CALC_FROM_ALL_DIRS)) + ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_SUPPRESSIONFIRE]); + return(AI_ACTION_CHANGE_STANCE); } else { pSoldier->aiData.usActionData = BestShot.sTarget; - ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_SUPPRESSIONFIRE]); + // show "suppression fire" message only if opponent cannot be seen after turning + if (!LOS_Raised(pSoldier, MercPtrs[BestShot.ubOpponent], CALC_FROM_ALL_DIRS)) + ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_SUPPRESSIONFIRE]); + return(AI_ACTION_FIRE_GUN); } }