From f8e1fd1e741694a63443c60dadb12983d752fcef Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 14 Apr 2018 18:34:49 +0000 Subject: [PATCH] Fix: zombies do not move due to low morale git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8552 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- TacticalAI/DecideAction.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index b74870b90..d466b43b3 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -6803,6 +6803,9 @@ INT8 ZombieDecideActionGreen(SOLDIERTYPE *pSoldier) DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("DecideActionGreen, orders = %d",pSoldier->aiData.bOrders)); + // it's a zombie, make sure they don't care about anything + pSoldier->aiData.bAIMorale = MORALE_FEARLESS; + gubNPCPathCount = 0; if ( !gGameExternalOptions.fEnemyTanksCanMoveInTactical && ARMED_VEHICLE( pSoldier ) ) @@ -7203,7 +7206,10 @@ INT8 ZombieDecideActionYellow(SOLDIERTYPE *pSoldier) #ifdef DEBUGDECISIONS STR16 tempstr; #endif - + + // it's a zombie, make sure they don't care about anything + pSoldier->aiData.bAIMorale = MORALE_FEARLESS; + // determine the most important noise heard, and its relative value sNoiseGridNo = MostImportantNoiseHeard(pSoldier,&iNoiseValue, &fClimb, &fReachable); @@ -7443,6 +7449,9 @@ INT8 ZombieDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK) DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ZombieDecideActionRed: soldier orders = %d",pSoldier->aiData.bOrders)); + // it's a zombie, make sure they don't care about anything + pSoldier->aiData.bAIMorale = MORALE_FEARLESS; + // if we have absolutely no action points, we can't do a thing under RED! if (!pSoldier->bActionPoints) { @@ -7452,8 +7461,7 @@ INT8 ZombieDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK) // can this guy move to any of the neighbouring squares ? (sets TRUE/FALSE) ubCanMove = (pSoldier->bActionPoints >= MinPtsToMove(pSoldier)); - - + // determine if we happen to be in water (in which case we're in BIG trouble!) bInWater = Water( pSoldier->sGridNo, pSoldier->pathing.bLevel ); bInDeepWater = Water( pSoldier->sGridNo, pSoldier->pathing.bLevel ); @@ -7469,8 +7477,7 @@ INT8 ZombieDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK) pSoldier->aiData.usActionData = NOWHERE; return(AI_ACTION_NONE); } - - + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: radio red alert?"); //////////////////////////////////////////////////////////////////////////// // RADIO RED ALERT: determine %chance to call others and report contact @@ -7594,7 +7601,7 @@ INT8 ZombieDecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK) // no watching bWatchPts = -99; } - + // modify RED movement tendencies according to morale switch (pSoldier->aiData.bAIMorale) { @@ -8135,6 +8142,9 @@ INT8 ZombieDecideActionBlack(SOLDIERTYPE *pSoldier) BOOLEAN fAllowCoverCheck = FALSE; DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"DecideActionBlack"); + + // it's a zombie, make sure they don't care about anything + pSoldier->aiData.bAIMorale = MORALE_FEARLESS; // if we have absolutely no action points, we can't do a thing under BLACK! if (!pSoldier->bActionPoints)