From d594ba0e67f8dc6a81ce4c974939fd9684150d30 Mon Sep 17 00:00:00 2001 From: Flugente Date: Fri, 13 May 2016 17:25:02 +0000 Subject: [PATCH] If a merc intentionally removes the diguise property via the [Ctrl] + [.] menu, the disguise property will not be reapplied until new clothes are applied, even if COVERT_STRIPIFUNCOVERED is set to FALSE in Skills_Settings.ini. This allows dressing up mercs in other colours without them being subject to covert mechanics. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8211 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 12 ++++++++++++ Tactical/Soldier Control.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index b15d62de..cb762898 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -15878,6 +15878,10 @@ void SOLDIERTYPE::Disguise() if ( !this->bActive || !this->bInSector ) return; + // if this flag is set, do not apply the disgusie properties + if ( this->usSoldierFlagMask2 & SOLDIER_COVERT_NOREDISGUISE ) + return; + ApplyCovert( FALSE ); } @@ -15889,6 +15893,11 @@ void SOLDIERTYPE::ApplyCovert( BOOLEAN aWithMessage ) // first, remove the covert flags, and then reapply the correct ones, in case we switch between civilian and military clothes this->usSoldierFlagMask &= ~(SOLDIER_COVERT_CIV | SOLDIER_COVERT_SOLDIER); + // if we apply the disguise property, remove the marker that we don't want this to happen + // the idea is that if we explicitly remove a disguise, but not our new colours, we don't want to regain the disguise + // we can then lose this marker again if we explicitly put on a disguise + this->usSoldierFlagMask2 &= ~SOLDIER_COVERT_NOREDISGUISE; + // we can only disguise successfully if we are not seen if ( !EnemySeenSoldierRecently( this ) ) { @@ -15930,6 +15939,9 @@ void SOLDIERTYPE::Strip() if ( this->usSoldierFlagMask & (SOLDIER_COVERT_CIV | SOLDIER_COVERT_SOLDIER) ) { LooseDisguise( ); + + // if we explicitly lose the disguise property, add a flag so that we aren't redisguised again immediately + this->usSoldierFlagMask2 |= SOLDIER_COVERT_NOREDISGUISE; } // if already not covert, take off clothes else if ( this->usSoldierFlagMask & (SOLDIER_NEW_VEST|SOLDIER_NEW_PANTS) ) diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index d9d03add..d35d9a7b 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -413,6 +413,8 @@ enum #define SOLDIER_HUNGOVER 0x00000400 //1024 // we drank alcohol recently, and are now hungover #define SOLDIER_TAKEN_LARGE_HIT 0x00000800 // we recently received a lot of damage in a single hit +#define SOLDIER_COVERT_NOREDISGUISE 0x00001000 // this soldier does not want to be redisguised + #define SOLDIER_INTERROGATE_ALL 0x000001F8 // all interrogation flags // ----------------------------------------------------------------