From 45f27fd8159f3b80c85a86f302ecaf1c45754201 Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 2 Jul 2013 19:03:14 +0000 Subject: [PATCH] Fix: covert gear was uncovered due to too high coolness when disguised as a soldier (should only apply to hand items) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6186 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 10c1c990..e4445437 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -14851,12 +14851,16 @@ BOOLEAN SOLDIERTYPE::EquipmentTooGood( BOOLEAN fCloselook ) return TRUE; } + // guns/launchers in our hands will always be noticed, even if covert, so we need to check them later + if ( bLoop == HANDPOS || bLoop == SECONDHANDPOS ) + ; + // other covert items are simply ignored + if ( HasItemFlag(this->inv[bLoop].usItem, COVERT) ) + continue; // further checks it item is not covert. This means that an item that has that tag will not be detected if it is 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) ) + else if ( (bLoop == GUNSLINGPOCKPOS || bLoop == HELMETPOS || bLoop == VESTPOS || bLoop == LEGPOS || bLoop == HEAD1POS || bLoop == HEAD2POS || bLoop == KNIFEPOCKPOS) ) ; - else if ( bLoop == KNIFEPOCKPOS && !HasItemFlag(this->inv[bLoop].usItem, COVERT) ) - ; - else if ( !HasItemFlag(this->inv[bLoop].usItem, COVERT) ) + else { // item will be detected if someone looks - check for the LBE item that gave us this slot. If that one is covert, this item is also covert UINT8 checkslot = 0;