From c10d2a6ed787f7c380c90c6a75fcfa11bea5e3b1 Mon Sep 17 00:00:00 2001 From: Wanne Date: Fri, 21 Oct 2011 06:00:22 +0000 Subject: [PATCH] - Bugfix: Updated unnecessary UpdateAirspaceControl (by Buggler) o The Patch fix was basically put there as a coder did not catch a scenario where Player can move into enemy SAM (& possibly other impt sectors) 'uncontested' aka player entered sector w no enemies but flagged as enemy controlled. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4729 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Player Command.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Strategic/Player Command.cpp b/Strategic/Player Command.cpp index bca4cf2da..c1296a72a 100644 --- a/Strategic/Player Command.cpp +++ b/Strategic/Player Command.cpp @@ -242,8 +242,8 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B } - // if player took control away from enemy - if( fWasEnemyControlled && fContested ) + // if player took control away from enemy + if( fWasEnemyControlled ) { // WDS - New AI // Hook in here for some stuff @@ -287,9 +287,10 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B HandleMoraleEvent( NULL, MORALE_SAM_SITE_LIBERATED, sMapX, sMapY, bMapZ ); HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_SAM, sMapX, sMapY, bMapZ ); + UpdateAirspaceControl( ); // if Skyrider has been delivered to chopper, and already mentioned Drassen SAM site, but not used this quote yet - if ( IsHelicopterPilotAvailable() && ( guiHelicopterSkyriderTalkState >= 1 ) && ( !gfSkyriderSaidCongratsOnTakingSAM ) ) + if ( IsHelicopterPilotAvailable( ) && ( guiHelicopterSkyriderTalkState >= 1 ) && ( !gfSkyriderSaidCongratsOnTakingSAM ) ) { SkyRiderTalk( SAM_SITE_TAKEN ); gfSkyriderSaidCongratsOnTakingSAM = TRUE; @@ -318,7 +319,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B // SetSectorFlag( sMapX, sMapY, bMapZ, SF_SECTOR_HAS_BEEN_LIBERATED_ONCE ); if ( bMapZ == 0 && ( ( sMapY == MAP_ROW_M && (sMapX >= 2 && sMapX <= 6) ) || sMapY == MAP_ROW_N && sMapX == 6) ) { - HandleOutskirtsOfMedunaMeanwhileScene(); + HandleOutskirtsOfMedunaMeanwhileScene( ); } } @@ -346,7 +347,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B //KM : Aug 11, 1999 -- Patch fix: Relocated this check so it gets called everytime a sector changes hands, // even if the sector isn't a SAM site. There is a bug _somewhere_ that fails to update the airspace, // even though the player controls it. - UpdateAirspaceControl( ); + //UpdateAirspaceControl( ); // redraw map/income if in mapscreen fMapPanelDirty = TRUE; @@ -424,6 +425,7 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO { HandleMoraleEvent( NULL, MORALE_SAM_SITE_LOST, sMapX, sMapY, bMapZ ); HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_LOSE_SAM, sMapX, sMapY, bMapZ ); + UpdateAirspaceControl( ); } // if it's a helicopter refueling site sector @@ -464,7 +466,7 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO //KM : Aug 11, 1999 -- Patch fix: Relocated this check so it gets called everytime a sector changes hands, // even if the sector isn't a SAM site. There is a bug _somewhere_ that fails to update the airspace, // even though the player controls it. - UpdateAirspaceControl( ); + //UpdateAirspaceControl( ); // redraw map/income if in mapscreen fMapPanelDirty = TRUE;