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
This commit is contained in:
Flugente
2013-06-26 18:19:33 +00:00
parent f43521f1fb
commit 5a89f6fa62
+8 -2
View File
@@ -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;