From f611cec05716562c1ffa6f56ec18f89182f5804f Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Fri, 30 Apr 2021 14:16:42 +0000 Subject: [PATCH] Fix for leaving merc never reaching final sector until current battle is finished (by Shadooow). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8991 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Strategic Movement.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Strategic/Strategic Movement.cpp b/Strategic/Strategic Movement.cpp index 1ea80d75..eba40c8e 100644 --- a/Strategic/Strategic Movement.cpp +++ b/Strategic/Strategic Movement.cpp @@ -1890,21 +1890,16 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe fExceptionQueue = TRUE; } } - - //First check if the group arriving is going to queue another battle. - //NOTE: We can't have more than one battle ongoing at a time. - if( fExceptionQueue || fCheckForBattle && gTacticalStatus.fEnemyInSector && + //First check if the group arriving is going to queue another battle. //KM : Aug 11, 1999 -- Patch fix: Added additional checks to prevent a 2nd battle in the case + //NOTE: We can't have more than one battle ongoing at a time. //where the player is involved in a potential battle with bloodcats/civilians + if( fExceptionQueue || (fCheckForBattle && (gTacticalStatus.fEnemyInSector || HostileCiviliansPresent() || HostileBloodcatsPresent()) && FindMovementGroupInSector( (UINT8)gWorldSectorX, (UINT8)gWorldSectorY, OUR_TEAM ) && - (pGroup->ubNextX != gWorldSectorX || pGroup->ubNextY != gWorldSectorY || gbWorldSectorZ > 0 ) || + (pGroup->ubNextX != gWorldSectorX || pGroup->ubNextY != gWorldSectorY || gbWorldSectorZ > 0 ) && NumHostilesInSector(pGroup->ubNextX, pGroup->ubNextY, pGroup->ubSectorZ) > 0) #ifdef JA2UB //Ja25: NO meanwhiles #else - AreInMeanwhile() || + || AreInMeanwhile() #endif - //KM : Aug 11, 1999 -- Patch fix: Added additional checks to prevent a 2nd battle in the case - // where the player is involved in a potential battle with bloodcats/civilians - fCheckForBattle && HostileCiviliansPresent() || - fCheckForBattle && HostileBloodcatsPresent() ) { //QUEUE BATTLE!