From b367fad8998505b8f7424f2d9f130c085e01183d Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Wed, 4 Dec 2019 13:27:24 +0000 Subject: [PATCH] Switch scope mode to default for suppressed soldier if he uses alt weapon holding. Improved AI path tweaks. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8715 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Overhead.cpp | 10 ++++++++-- Tactical/PATHAI.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 45dc4f17..9195e1f9 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -8785,11 +8785,11 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker ) DebugAttackBusy( String("!!!!!!! Starting suppression, on %d\n", pSoldier->ubID ) ); //gTacticalStatus.ubAttackBusyCount++; - // make sure supressor ID is the same! + // make sure suppressor ID is the same! pSoldier->ubSuppressorID = ubCausedAttacker; } - // AI people will have to have their actions cancelled + // AI people will have to have their actions canceled if (!(pSoldier->flags.uiStatusFlags & SOLDIER_PC)) { CancelAIAction( pSoldier, TRUE ); @@ -8809,6 +8809,12 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker ) gTacticalStatus.ubAttackBusyCount++; DebugAttackBusy( String( "Attack busy %d due to suppression fire on %d\n", gTacticalStatus.ubAttackBusyCount, pSoldier->ubID )); + // sevenfm: switch scope mode as alt holding can only be used in standing stance + if (pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD) + { + pSoldier->bScopeMode = USE_BEST_SCOPE; + } + DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleSuppressionFire: change stance")); pSoldier->ChangeSoldierStance( ubNewStance ); diff --git a/Tactical/PATHAI.cpp b/Tactical/PATHAI.cpp index 431709ba..13725a8a 100644 --- a/Tactical/PATHAI.cpp +++ b/Tactical/PATHAI.cpp @@ -3849,7 +3849,7 @@ if(!GridNoOnVisibleWorldTile(iDestination)) IS_MERC_BODY_TYPE(s) && (InGasSpot(s, newLoc, bLevel) || DeepWater(newLoc, bLevel) && (s->numFlanks == 0 || s->numFlanks >= MAX_FLANKS_RED) || - (s->aiData.bAlertStatus >= STATUS_RED && (s->aiData.bAttitude == CUNNINGSOLO || s->aiData.bAttitude == CUNNINGAID || s->aiData.bAIMorale < MORALE_FEARLESS)) && + s->bTeam == ENEMY_TEAM && s->aiData.bAlertStatus >= STATUS_RED && (s->aiData.bAttitude == CUNNINGSOLO || s->aiData.bAttitude == CUNNINGAID || s->aiData.bAIMorale < MORALE_FEARLESS) && (InLightAtNight(newLoc, bLevel) || GetNearestRottingCorpseAIWarning(newLoc) > 0))) { nextCost += 20;