From dfc55c286d721f584918685d9a5b60ad0d2323ee Mon Sep 17 00:00:00 2001 From: Flugente Date: Thu, 28 Sep 2017 19:40:49 +0000 Subject: [PATCH] Fix: boxing exception to covert behaviour only works between 2 boxers git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8482 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Boxing.cpp | 12 ++++++++++++ Tactical/Soldier Control.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Tactical/Boxing.cpp b/Tactical/Boxing.cpp index 823e3127..d0f0680a 100644 --- a/Tactical/Boxing.cpp +++ b/Tactical/Boxing.cpp @@ -273,7 +273,14 @@ void CountPeopleInBoxingRingAndDoActions( void ) { // time to go to pre-boxing SetBoxingState( PRE_BOXING ); + + // Flugente: in order for boxing to work while covert, we require the boxer to recognize our covert merc as a boxer, but that flag is not yet set + // so temporarily set the flag, recognize our merc, and then remove the flag again. it will be properly set later + pInRing[0]->flags.uiStatusFlags |= SOLDIER_BOXER; + PickABoxer(); + + pInRing[0]->DeleteBoxingFlag(); } } else @@ -555,8 +562,13 @@ void ClearAllBoxerFlags( void ) { if ( MercSlots[ uiSlot ] && MercSlots[ uiSlot ]->flags.uiStatusFlags & SOLDIER_BOXER ) { + // Flugente: nuke the entire opponent count, remove boxing flag, reevaluate opponent list + DecayIndividualOpplist(MercSlots[uiSlot]); + MercSlots[ uiSlot ]->DeleteBoxingFlag(); + ManLooksForOtherTeams(MercSlots[uiSlot]); + if ( MercSlots[uiSlot]->bTeam == gbPlayerNum ) MercSlots[uiSlot]->flags.uiStatusFlags &= (~SOLDIER_PCUNDERAICONTROL); } diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index 12cd952a..519cc707 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -644,7 +644,7 @@ extern CLOTHES_STRUCT Clothes[CLOTHES_MAX]; #define CONSIDERED_NEUTRAL( me, them ) (\ ( them->aiData.bNeutral || them->usSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER|SOLDIER_POW) ) \ && ( me->bTeam != CREATURE_TEAM || (them->flags.uiStatusFlags & SOLDIER_VEHICLE) ) \ - && !( me->flags.uiStatusFlags & SOLDIER_BOXER || them->flags.uiStatusFlags & SOLDIER_BOXER ) \ + && !( me->flags.uiStatusFlags & SOLDIER_BOXER && them->flags.uiStatusFlags & SOLDIER_BOXER ) \ ) typedef struct