From 2c2692425659200beb94ff4b0f9e92ed8a38e995 Mon Sep 17 00:00:00 2001 From: MaddMugsy Date: Wed, 21 Jun 2006 19:08:59 +0000 Subject: [PATCH] -put light check back to where it was before git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@282 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- TacticalAI/DecideAction.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index e6c5db5a..d57a4426 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -2036,6 +2036,18 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK) } } + //////////////////////////////////////////////////////////////////////////// + // WHEN IN THE LIGHT, GET OUT OF THERE! + //////////////////////////////////////////////////////////////////////////// + if ( ubCanMove && InLightAtNight( pSoldier->sGridNo, pSoldier->bLevel ) && pSoldier->bOrders != STATIONARY ) + { + pSoldier->usActionData = FindNearbyDarkerSpot( pSoldier ); + if ( pSoldier->usActionData != NOWHERE ) + { + // move as if leaving water or gas + return( AI_ACTION_LEAVE_WATER_GAS ); + } + } if ( fCivilian && !( pSoldier->ubBodyType == COW || pSoldier->ubBodyType == CRIPPLECIV ) ) { @@ -2339,19 +2351,6 @@ if ( !fCivilian && pSoldier->bTeam != MILITIA_TEAM && gGameOptions.fAirStrikes & } */ - //////////////////////////////////////////////////////////////////////////// - // WHEN IN THE LIGHT, GET OUT OF THERE! - //////////////////////////////////////////////////////////////////////////// - if ( ubCanMove && InLightAtNight( pSoldier->sGridNo, pSoldier->bLevel ) && pSoldier->bOrders != STATIONARY ) - { - pSoldier->usActionData = FindNearbyDarkerSpot( pSoldier ); - if ( pSoldier->usActionData != NOWHERE ) - { - // move as if leaving water or gas - return( AI_ACTION_LEAVE_WATER_GAS ); - } - } - DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: crouch and rest if running out of breath"); //////////////////////////////////////////////////////////////////////// // CROUCH & REST IF RUNNING OUT OF BREATH