From 623dcca3ed54c6cded00619588de8d4426205fb2 Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 27 Aug 2012 20:48:39 +0000 Subject: [PATCH] fix: carrying corpses did not raise suspicion like it should git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5539 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 70963d33..0fc92da0 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -14440,6 +14440,10 @@ BOOLEAN SOLDIERTYPE::LooksLikeACivilian( void ) if ( bLoop >= VESTPOCKPOS && bLoop <= CPACKPOCKPOS ) continue; + // seriously? a corpse? of course this is suspicious! + if ( HasItemFlag(this->inv[bLoop].usItem, CORPSE) ) + return FALSE; + BOOLEAN checkfurther = FALSE; // further checks it item is not covert. This means that a gun that has that tag will not be detectedif if its inside a pocket! if ( bLoop == HANDPOS || bLoop == SECONDHANDPOS || bLoop == GUNSLINGPOCKPOS || bLoop == HELMETPOS || bLoop == VESTPOS || bLoop == LEGPOS || bLoop == HEAD1POS || bLoop == HEAD2POS ) @@ -14519,6 +14523,17 @@ BOOLEAN SOLDIERTYPE::LooksLikeACivilian( void ) // do we look like a soldier? BOOLEAN SOLDIERTYPE::LooksLikeASoldier( void ) { + INT8 invsize = (INT8)this->inv.size(); + for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ... + { + if ( this->inv[bLoop].exists() ) + { + // seriously? a corpse? of course this is suspicious! + if ( HasItemFlag(this->inv[bLoop].usItem, CORPSE) ) + return FALSE; + } + } + return TRUE; } @@ -14746,7 +14761,7 @@ BOOLEAN SOLDIERTYPE::SeemsLegit( UINT8 ubObserverID ) // if we are trying to dress like a soldier, but aren't sucessful: not covert if ( this->bSoldierFlagMask & SOLDIER_COVERT_SOLDIER && !looklikeasoldier) { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s does not look like a soldier!", this->name ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s is carrying a corpse!", this->name ); return FALSE; }