Wrap PBI status flags in accessors

gfPreBattleInterfaceActive and gfUsePersistantPBI are now file-static in
PreBattle Interface.cpp, reached only through Is/Set accessors declared in
the header. No behavior change: getters return BOOLEAN so ==TRUE/==FALSE
sites are untouched semantically.

Verify: grep 'gfPreBattleInterfaceActive\|gfUsePersistantPBI' across the tree
hits only the two static definitions, the four accessor bodies (all in
PreBattle Interface.cpp), and two commented-out Asserts in Strategic
Movement.cpp. Every other former site now calls an accessor. Build: JA2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Marco Antonio J. Costa
2026-08-02 14:58:24 -03:00
committed by majcosta
co-authored by Claude Opus 4.8
parent d683cdeb64
commit dbf6e1cd10
11 changed files with 68 additions and 64 deletions
+3 -4
View File
@@ -80,7 +80,6 @@ GROUP *gpPendingSimultaneousGroup = NULL;
// is the bottom of the map panel dirty?
extern BOOLEAN fMapScreenBottomDirty;
extern BOOLEAN gfUsePersistantPBI;
extern BOOLEAN gfExitViewer;
BOOLEAN ValidateGroups( GROUP *pGroup );
@@ -1378,7 +1377,7 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup )
{
//Prepare for instant autoresolve.
gfDelayAutoResolveStart = TRUE;
gfUsePersistantPBI = TRUE;
SetPersistantPBI( TRUE );
if( fMilitiaPresent )
{
NotifyPlayerOfInvasionByEnemyForces( pGroup->ubSectorX, pGroup->ubSectorY, 0, TriggerPrebattleInterface );
@@ -5504,7 +5503,7 @@ void NotifyPlayerOfBloodcatBattle( UINT8 ubSectorX, UINT8 ubSectorY )
RefreshScreen( NULL );
}
gfUsePersistantPBI = TRUE;
SetPersistantPBI( TRUE );
DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, TriggerPrebattleInterface );
}
@@ -6209,7 +6208,7 @@ void CheckCombatInSectorDueToUnusualEnemyArrival( UINT8 aTeam, INT16 sX, INT16 s
{
//Prepare for instant autoresolve.
gfDelayAutoResolveStart = TRUE;
gfUsePersistantPBI = TRUE;
SetPersistantPBI( TRUE );
if ( fMilitiaPresent )
{
NotifyPlayerOfInvasionByEnemyForces( sX, sY, 0, TriggerPrebattleInterface );