Fix only one faction having access to Anomaly research in Multifaction #496
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Multifaction, only one of the factions can access the Anomaly research tab. Anomaly tab is unlocked when awakening the monolith, but the Anomaly state is global (rather than per-player) which means that there should ever be 1 monolith, and awakening it progresses the Anomaly level for everyone. The issue here is that the code that unlocks Anomaly research tab runs for a single player, meaning that everyone besides the person triggering it will be locked out of it. It also won't unlock for factions unlocked after raising the Anomaly level either.
Changes:
ResearchManager.Notify_MonolithLevelChanged
, and then called the method with faction repeater to ensure that unlocking research applies to all active factionsResearchManager:Notify_MonolithLevelChanged
insideFactionCreator:InitNewGame
to unlock Anomaly research for new factionsResearchManager:Notify_MonolithLevelChanged
insideMultiplayerWorldComp:DoBackCompat
to unlock Anomaly research for factions created before the fix was introducedDoBackCompat
as it seemed fitting to me, but it could be moved to a different location if neededBuilding_VoidMonolith:SpawnSetup
HostUtil:SetupGameFromSingleplayer
@Zetrith if you'd like me to move the code fixing existing save files somewhere else that's not
DoBackCompat
, or make some other changes, just let me know.