mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Massive effort to reign in militia problem. Still has issues :(
Fix: If only some of mercs go to a lower level (mine, basement, etc) but do not choose to "GO TO SECTOR", sector is still inaccessible from strategic map. However, watch for triggers that might happen on first visit to a sector, that fail. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1076 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -51,6 +51,8 @@
|
||||
|
||||
#include "MilitiaSquads.h"
|
||||
|
||||
extern UINT32 guiLastTacticalRealTime;
|
||||
|
||||
// the delay for a group about to arrive
|
||||
#define ABOUT_TO_ARRIVE_DELAY 5
|
||||
|
||||
@@ -1075,6 +1077,7 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup )
|
||||
if( NumEnemiesInSector( pGroup->ubSectorX, pGroup->ubSectorY ) )
|
||||
{
|
||||
fBattlePending = TRUE;
|
||||
StopTimeCompression();
|
||||
}
|
||||
|
||||
if( pGroup->uiFlags & GROUPFLAG_HIGH_POTENTIAL_FOR_AMBUSH && fBattlePending )
|
||||
@@ -1089,6 +1092,7 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup )
|
||||
{
|
||||
fBloodCatAmbush = TRUE;
|
||||
fBattlePending = TRUE;
|
||||
StopTimeCompression();
|
||||
}
|
||||
|
||||
if( fBattlePending && (!fBloodCatAmbush || gubEnemyEncounterCode == ENTERING_BLOODCAT_LAIR_CODE) )
|
||||
@@ -1118,7 +1122,7 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup )
|
||||
}
|
||||
|
||||
if( fBattlePending )
|
||||
{ //A battle is pending, but the player's could be all unconcious or dead.
|
||||
{ //A battle is pending, but the players could be all unconcious or dead.
|
||||
//Go through every group until we find at least one concious merc. The looping will determine
|
||||
//if there are any live mercs and/or concious ones. If there are no concious mercs, but alive ones,
|
||||
//then we will go straight to autoresolve, where the enemy will likely annihilate them or capture them.
|
||||
@@ -1128,6 +1132,8 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup )
|
||||
ValidateGroups( pGroup );
|
||||
#endif
|
||||
|
||||
StopTimeCompression();
|
||||
|
||||
if( gubNumGroupsArrivedSimultaneously )
|
||||
{ //Because this is a battle case, clear all the group flags
|
||||
curr = gpGroupList;
|
||||
@@ -1970,7 +1976,7 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
if ( !fGroupDestroyed )
|
||||
{
|
||||
//Determine if a battle should start.
|
||||
//if a battle does start, or get's delayed, then we will keep the group in memory including
|
||||
//if a battle does start, or gets delayed, then we will keep the group in memory including
|
||||
//all waypoints, until after the battle is resolved. At that point, we will continue the processing.
|
||||
if( fCheckForBattle && !CheckConditionsForBattle( pGroup ) && !gfWaitingForInput )
|
||||
{
|
||||
@@ -2706,6 +2712,8 @@ void SetGroupSectorValue( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, UINT8
|
||||
}
|
||||
|
||||
CheckAndHandleUnloadingOfCurrentWorld();
|
||||
|
||||
SetSectorFlag( sSectorX, sSectorY, (UINT8) sSectorZ, SF_ALREADY_VISITED);
|
||||
}
|
||||
|
||||
void SetEnemyGroupSector( GROUP *pGroup, UINT8 ubSectorID )
|
||||
|
||||
Reference in New Issue
Block a user