diff --git a/Components/DLC2CommunityHighlander/DLC2CommunityHighlander/Src/DLC_2/Classes/X2DownloadableContentInfo_DLC_Day60.uc b/Components/DLC2CommunityHighlander/DLC2CommunityHighlander/Src/DLC_2/Classes/X2DownloadableContentInfo_DLC_Day60.uc index df0e517f5..caa609b21 100644 --- a/Components/DLC2CommunityHighlander/DLC2CommunityHighlander/Src/DLC_2/Classes/X2DownloadableContentInfo_DLC_Day60.uc +++ b/Components/DLC2CommunityHighlander/DLC2CommunityHighlander/Src/DLC_2/Classes/X2DownloadableContentInfo_DLC_Day60.uc @@ -345,20 +345,23 @@ static event UpdateDLC() local XComGameStateHistory History; local XComGameState NewGameState; local XComGameState_AlienRulerManager RulerMgr; - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bUpdated; if (class'X2Helpers_DLC_Day60'.static.IsXPackIntegrationEnabled()) { History = `XCOMHISTORY; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; RulerMgr = XComGameState_AlienRulerManager(History.GetSingleGameStateObjectForClass(class'XComGameState_AlienRulerManager')); NewGameState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("Update Alien Hunters DLC"); RulerMgr = XComGameState_AlienRulerManager(NewGameState.ModifyStateObject(class'XComGameState_AlienRulerManager', RulerMgr.ObjectID)); // Don't trigger updates while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { bUpdated = RulerMgr.ActivateRulerLocations(); // Check for any new rulers getting activated, and set their timers bUpdated = bUpdated || RulerMgr.UpdateRulerLocations(); diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc index 098fb3419..3e7a1a964 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc @@ -1129,4 +1129,20 @@ static final function array RebuildSoldierClassAbilityT return AbilityTypes; } -// End Issue #815 \ No newline at end of file +// End Issue #815 + +/// HL-Docs: ref:Bugfixes; issue:1417 +/// This helper function uses a more robust check to ensure the geoscape is ready for alerts. +/// This replaces functions that only check for the presence of a UIAlert screen, which can +/// result in popups in places such as Squad Select or the Black Market screen if the campaign date lines up with flight time. +static function bool GeoscapeReadyForUpdate() +{ + local UIStrategyMap StrategyMap; + + StrategyMap = `HQPRES.StrategyMap2D; + + return + StrategyMap != none && + StrategyMap.m_eUIState != eSMS_Flight && + StrategyMap.Movie.Pres.ScreenStack.GetCurrentScreen() == StrategyMap; +} diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_AdventChosen.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_AdventChosen.uc index ef2558566..d9c03be1e 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_AdventChosen.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_AdventChosen.uc @@ -1881,12 +1881,14 @@ function bool IsFavored() // THIS FUNCTION SHOULD RETURN TRUE IN ALL THE SAME CASES AS Update function bool ShouldUpdate() { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; - StrategyMap = `HQPRES.StrategyMap2D; + //StrategyMap = `HQPRES.StrategyMap2D; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (bMetXCom && !bSeenLocationReveal) { @@ -1901,14 +1903,17 @@ function bool ShouldUpdate() // IF ADDING NEW CASES WHERE bModified = true, UPDATE FUNCTION ShouldUpdate ABOVE function bool Update(XComGameState NewGameState) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bModified; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; bModified = false; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (bMetXCom && !bSeenLocationReveal) { diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_AlienNetworkComponent.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_AlienNetworkComponent.uc index e4c20abd7..e68ba8aeb 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_AlienNetworkComponent.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_AlienNetworkComponent.uc @@ -112,15 +112,18 @@ function bool CanAffordIntelCost() function bool Update(XComGameState NewGameState) { local XComGameState_HeadquartersAlien AlienHQ; - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bUpdated; local int HoursToAdd; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; bUpdated = false; // Do not modify doom while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (class'X2StrategyGameRulesetDataStructures'.static.LessThan(DoomProjectIntervalEndTime, `STRATEGYRULES.GameTime)) { diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_BlackMarket.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_BlackMarket.uc index 98b08ab50..1677cc43c 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_BlackMarket.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_BlackMarket.uc @@ -606,12 +606,14 @@ function CleanUpForSaleItems(XComGameState NewGameState) // THIS FUNCTION SHOULD RETURN TRUE IN ALL THE SAME CASES AS Update function bool ShouldUpdate( ) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; - StrategyMap = `HQPRES.StrategyMap2D; + //StrategyMap = `HQPRES.StrategyMap2D; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass( class'UIAlert' )) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { // Check if making contact is complete if (bNeedsScan && IsScanComplete( )) @@ -627,14 +629,17 @@ function bool ShouldUpdate( ) // IF ADDING NEW CASES WHERE bModified = true, UPDATE FUNCTION ShouldUpdate ABOVE function bool Update(XComGameState NewGameState) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bModified; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; bModified = false; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { // Check if making contact is complete if (bNeedsScan && IsScanComplete()) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_CovertAction.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_CovertAction.uc index e6c43be03..e1ca59c4b 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_CovertAction.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_CovertAction.uc @@ -1544,13 +1544,17 @@ function bool DidRiskOccur(name RiskName) function bool ShouldUpdate() { local XComGameState_HeadquartersXCom XComHQ; - local UIStrategyMap StrategyMap; + + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; XComHQ = class'UIUtilities_Strategy'.static.GetXComHQ(); - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (!bCompleted) { diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Haven.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Haven.uc index f22b51d05..84ee850e7 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Haven.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Haven.uc @@ -58,12 +58,14 @@ static function SetUpHavens(XComGameState StartState) // THIS FUNCTION SHOULD RETURN TRUE IN ALL THE SAME CASES AS Update function bool ShouldUpdate( ) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; - StrategyMap = `HQPRES.StrategyMap2D; + //StrategyMap = `HQPRES.StrategyMap2D; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass( class'UIAlert' )) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (IsScanComplete( )) { @@ -80,17 +82,20 @@ function bool Update(XComGameState NewGameState) { local XComGameState_HeadquartersXCom XComHQ; local XComGameState_HeadquartersResistance ResHQ; - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bUpdated; local int IntelRewardAmt; XComHQ = class'UIUtilities_Strategy'.static.GetXComHQ(); ResHQ = class'UIUtilities_Strategy'.static.GetResistanceHQ(); - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; bUpdated = false; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (IsScanComplete()) { diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_HeadquartersResistance.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_HeadquartersResistance.uc index 8a450e341..48331aa26 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_HeadquartersResistance.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_HeadquartersResistance.uc @@ -279,14 +279,17 @@ function name SelectNextSoldierClass() // returns true if an internal value has changed (lots of time checks) function bool Update(XComGameState NewGameState) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bUpdated; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; bUpdated = false; // Don't trigger end of month while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (!bInactive) { diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_MissionCalendar.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_MissionCalendar.uc index d3578530a..68edcb97c 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_MissionCalendar.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_MissionCalendar.uc @@ -52,13 +52,16 @@ static function SetupCalendar(XComGameState StartState) //--------------------------------------------------------------------------------------- function bool Update(XComGameState NewGameState) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local int idx; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; // Do not spawn any new missions while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { // Check for mission events for (idx = 0; idx < CurrentMissionMonth.Length; idx++) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_ResistanceFaction.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_ResistanceFaction.uc index 03b42319c..50c20c01c 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_ResistanceFaction.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_ResistanceFaction.uc @@ -1384,12 +1384,14 @@ function string GetResistanceModeLabel() // THIS FUNCTION SHOULD RETURN TRUE IN ALL THE SAME CASES AS Update function bool ShouldUpdate() { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; - StrategyMap = `HQPRES.StrategyMap2D; + //StrategyMap = `HQPRES.StrategyMap2D; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (bMetXCom && !bSeenFactionHQReveal) { @@ -1404,14 +1406,17 @@ function bool ShouldUpdate() // IF ADDING NEW CASES WHERE bModified = true, UPDATE FUNCTION ShouldUpdate ABOVE function bool Update(XComGameState NewGameState) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bModified; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; bModified = false; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (bMetXCom && !bSeenFactionHQReveal) { diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_UFO.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_UFO.uc index 942506924..eec6c07dc 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_UFO.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_UFO.uc @@ -449,7 +449,8 @@ function XComGameState_MissionSiteAvengerDefense CreateAvengerDefenseMission(Sta //--------------------------------------------------------------------------------------- function bool Update(XComGameState NewGameState) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bModified; bModified = false; @@ -473,8 +474,9 @@ function bool Update(XComGameState NewGameState) } // Do not trigger interception while the Avenger or Skyranger are flying, or if another popup is already being presented - StrategyMap = `HQPRES.StrategyMap2D; - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + //StrategyMap = `HQPRES.StrategyMap2D; + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { // If we have hit our interception time, become visible, transport to be close to XComHQ, and start the attack if (class'X2StrategyGameRulesetDataStructures'.static.LessThan(InterceptionTime, GetCurrentTime())) diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_WorldRegion.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_WorldRegion.uc index bf6b25356..2cacbcd58 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_WorldRegion.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_WorldRegion.uc @@ -466,11 +466,13 @@ function BuildHavenETA(out int MinDays, out int MaxDays) // THIS FUNCTION SHOULD RETURN TRUE IN ALL THE SAME CASES AS Update function bool ShouldUpdate( ) { - local UIStrategyMap StrategyMap; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + // local UIStrategyMap StrategyMap; + // StrategyMap = `HQPRES.StrategyMap2D; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass( class'UIAlert' )) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (bUpdateShortestPathsToMissions) { @@ -503,14 +505,17 @@ function bool ShouldUpdate( ) // IF ADDING NEW CASES WHERE bModified = true, UPDATE FUNCTION ShouldUpdate ABOVE function bool Update(XComGameState NewGameState) { - local UIStrategyMap StrategyMap; + // Issue #1417: no longer used + //local UIStrategyMap StrategyMap; local bool bModified; - StrategyMap = `HQPRES.StrategyMap2D; + // Issue #1417: no longer used + //StrategyMap = `HQPRES.StrategyMap2D; bModified = false; // Do not trigger anything while the Avenger or Skyranger are flying, or if another popup is already being presented - if (StrategyMap != none && StrategyMap.m_eUIState != eSMS_Flight && !`HQPRES.ScreenStack.IsCurrentClass(class'UIAlert')) + // Issue #1417: Use a more robust check to determine if the game should trigger the update. + if (class'CHHelpers'.static.GeoscapeReadyForUpdate()) { if (bUpdateShortestPathsToMissions) {