mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Encapsulate PBI Category-1 transition flags as file-statics
gfEnteringMapScreenToEnterPreBattleInterface, gfAutomaticallyStartAutoResolve and gfDelayAutoResolveStart are now file-static in PreBattle Interface.cpp (the latter's definition moved here from Strategic Movement.cpp). External access goes through accessors declared in the header; PBI.cpp touches the statics directly. Accessors exist only where an external caller needs one: AutomaticallyStartAutoResolve() getter (read in Town Militia, gamescreen, Player Command); SetAutomaticallyStartAutoResolve (set in Creature Spreading, strategicmap); SetDelayAutoResolveStart (set in Strategic Movement); SetEnteringMapScreenToEnterPreBattleInterface (set in strategicmap). gfEnteringMapScreen stays a raw cross-read into mapscreen state, not PBI-owned. No behavior change: getter returns BOOLEAN. Verify: grep the three flag names across the tree hits only PreBattle Interface.cpp (three static defs, four accessor bodies, and in-file Handle/reader access). No header externs, no external raw refs. Build: JA2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
majcosta
co-authored by
Claude Opus 4.8
parent
f1d5431660
commit
380fedca10
@@ -88,8 +88,6 @@ BOOLEAN ValidateGroups( GROUP *pGroup );
|
||||
extern BOOLEAN gubNumAwareBattles;
|
||||
extern INT8 SquadMovementGroups[ ];
|
||||
|
||||
BOOLEAN gfDelayAutoResolveStart = FALSE;
|
||||
|
||||
|
||||
BOOLEAN gfRandomizingPatrolGroup = FALSE;
|
||||
|
||||
@@ -1052,7 +1050,7 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating
|
||||
if ( pPlayerDialogGroup->usGroupTeam == MILITIA_TEAM )
|
||||
{
|
||||
// force direct transition to autoresolve
|
||||
gfDelayAutoResolveStart = TRUE;
|
||||
SetDelayAutoResolveStart( TRUE );
|
||||
|
||||
// We MUST start combat, but donot play quote...
|
||||
InitPreBattleInterface( pInitiatingBattleGroup, TRUE );
|
||||
@@ -1376,7 +1374,7 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup )
|
||||
if( !fCombatAbleMerc )
|
||||
{
|
||||
//Prepare for instant autoresolve.
|
||||
gfDelayAutoResolveStart = TRUE;
|
||||
SetDelayAutoResolveStart( TRUE );
|
||||
SetPersistantPBI( TRUE );
|
||||
if( fMilitiaPresent )
|
||||
{
|
||||
@@ -6207,7 +6205,7 @@ void CheckCombatInSectorDueToUnusualEnemyArrival( UINT8 aTeam, INT16 sX, INT16 s
|
||||
if ( !fCombatAbleMerc )
|
||||
{
|
||||
//Prepare for instant autoresolve.
|
||||
gfDelayAutoResolveStart = TRUE;
|
||||
SetDelayAutoResolveStart( TRUE );
|
||||
SetPersistantPBI( TRUE );
|
||||
if ( fMilitiaPresent )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user