Skip to content

Commit

Permalink
Fix zones breaking for the host after a reload in multifaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetrith committed Apr 15, 2024
1 parent 81fd504 commit 1ff64b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/Client/Saving/SaveLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ public static TempGameData SaveAndReload()
TempGameData gameData;
using (DeepProfilerWrapper.Section("Multiplayer SaveAndReload: Save"))
{
// When reloading in multifaction always save as the spectator faction to ensure determinism
// When reloading in multifaction always save as a fixed faction to ensure determinism
// The faction is chosen to be the first player faction in the FactionManager as this is what
// Faction.OfPlayer gets set to initially during loading (in FactionManager.ExposeData -> RecacheFactions)
if (Multiplayer.GameComp.multifaction)
Multiplayer.game.ChangeRealPlayerFaction(Multiplayer.WorldComp.spectatorFaction, false);
Multiplayer.game.ChangeRealPlayerFaction(Find.FactionManager.AllFactions.First(f => f.IsPlayer), false);
gameData = SaveGameData();
}

Expand Down

0 comments on commit 1ff64b8

Please sign in to comment.