From 53821fcf49689ee6e4b5abec86a597a598d4e008 Mon Sep 17 00:00:00 2001 From: Wanne Date: Thu, 18 Feb 2010 19:16:57 +0000 Subject: [PATCH] Various Bugfixes by Headrock: - Fixed: NPC and PC movement errors - Fixed: Boxers in San Mona do not leave the boxing ring after the fight - Fixed: Darren does not pay the cash after you won the boxing fight git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3320 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Boxing.cpp | 8 ++++++++ Tactical/Soldier Control.cpp | 9 ++++++--- TacticalAI/DecideAction.cpp | 4 +++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Tactical/Boxing.cpp b/Tactical/Boxing.cpp index c62eeced..e8dd247e 100644 --- a/Tactical/Boxing.cpp +++ b/Tactical/Boxing.cpp @@ -83,6 +83,14 @@ void ExitBoxing( void ) pSoldier->aiData.bAlertStatus = STATUS_GREEN; pSoldier->aiData.bUnderFire = 0; + // HEADROCK HAM 3.6: Make sure all boxers' APs have been reset to a reasonable number. Otherwise, + // the AI combatant may fail several conditions in subsequent functions, and fail to leave the ring + // as a result. + if (pSoldier->bActionPoints < (APBPConstants[AP_MAXIMUM]*6)/10) + { + pSoldier->bActionPoints = (APBPConstants[AP_MAXIMUM]*6)/10; + } + // if necessary, revive boxer so he can leave ring if (pSoldier->stats.bLife > 0 && (pSoldier->stats.bLife < OKLIFE || pSoldier->bBreath < OKBREATH ) ) { diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 79be4eb6..d177a789 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -6616,18 +6616,21 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou // in the previous turn, then the player has apparently forgotten that he was moving. // In this case, abort the character's action. - // If haven't moved since the start of last round - if (!this->bTilesMoved) + // If hasn't moved since the start of last round + // AND this function is being executed in Turn Based mode + // AND character is a player-controlled merc + if (!fFromRealTime && !this->bTilesMoved && this->bTeam == OUR_TEAM ) { // but are doing a movement animation if ( !( gAnimControl[ this->usAnimState ].uiFlags & ANIM_STATIONARY ) ) { // Stop the merc this->EVENT_StopMerc( this->sGridNo, this->ubDirection ); + this->pathing.sFinalDestination = NOWHERE; } // Reset destination - this->pathing.sFinalDestination = this->sGridNo; + //this->pathing.sFinalDestination = this->sGridNo; } this->bTilesMoved = 0; diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index 365756d6..5617816f 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -738,8 +738,10 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier) // character then didn't trigger the end of boxing record // (and we know from the if statement above that we're // still in a boxing state of some sort...) - TriggerEndOfBoxingRecord( NULL ); + //TriggerEndOfBoxingRecord( NULL ); + // HEADROCK HAM 3.6: This should trigger Darren's script + TriggerEndOfBoxingRecord( pSoldier ); } } }