From 5a89f6fa62ba390b1c9403e8a33b50dc8cd123b5 Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 26 Jun 2013 18:19:33 +0000 Subject: [PATCH] Fix: civilians could openly wield covert guns git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6161 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index ada993b56..10c1c9905 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -14668,11 +14668,17 @@ BOOLEAN SOLDIERTYPE::LooksLikeACivilian( void ) } BOOLEAN checkfurther = FALSE; - // further checks it item is not covert. This means that a gun that has that tag will not be detected if its inside a pocket! - if ( !HasItemFlag(this->inv[bLoop].usItem, COVERT) && (bLoop == HANDPOS || bLoop == SECONDHANDPOS || bLoop == GUNSLINGPOCKPOS || bLoop == HELMETPOS || bLoop == VESTPOS || bLoop == LEGPOS || bLoop == HEAD1POS || bLoop == HEAD2POS) ) + + // guns/launchers in our hands will always be noticed, even if covert + if ( (Item[this->inv[bLoop].usItem].usItemClass & (IC_GUN|IC_LAUNCHER)) && (bLoop == HANDPOS || bLoop == SECONDHANDPOS ) ) checkfurther = TRUE; + // visible slots are always checked if not covert + else if ( !HasItemFlag(this->inv[bLoop].usItem, COVERT) && (bLoop == HANDPOS || bLoop == SECONDHANDPOS || bLoop == GUNSLINGPOCKPOS || bLoop == HELMETPOS || bLoop == VESTPOS || bLoop == LEGPOS || bLoop == HEAD1POS || bLoop == HEAD2POS) ) + checkfurther = TRUE; + // knife slot is checked if the knife is not covert else if ( bLoop == KNIFEPOCKPOS && !HasItemFlag(this->inv[bLoop].usItem, COVERT) ) checkfurther = TRUE; + // further checks it item is not covert. This means that a gun that has that tag will not be detected if its inside a pocket! else if ( !HasItemFlag(this->inv[bLoop].usItem, COVERT) ) { checkfurther = TRUE;