File tree Expand file tree Collapse file tree 4 files changed +17
-8
lines changed
Expand file tree Collapse file tree 4 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ public void ChangeRealPlayerFaction(int newFaction)
123123 ChangeRealPlayerFaction ( Find . FactionManager . GetById ( newFaction ) ) ;
124124 }
125125
126- public void ChangeRealPlayerFaction ( Faction newFaction )
126+ public void ChangeRealPlayerFaction ( Faction newFaction , bool regenMapDrawers = true )
127127 {
128128 Log . Message ( $ "Changing real player faction to { newFaction } from { myFaction } ") ;
129129
@@ -136,7 +136,8 @@ public void ChangeRealPlayerFaction(Faction newFaction)
136136
137137 foreach ( Map m in Find . Maps )
138138 {
139- m . mapDrawer . RegenerateEverythingNow ( ) ;
139+ if ( regenMapDrawers )
140+ m . mapDrawer . RegenerateEverythingNow ( ) ;
140141
141142 foreach ( var t in m . listerThings . AllThings )
142143 if ( t is ThingWithComps tc )
Original file line number Diff line number Diff line change 77using System . Threading ;
88using System . Xml ;
99using Multiplayer . Client . Saving ;
10+ using Multiplayer . Client . Util ;
1011using UnityEngine ;
1112using Verse ;
1213using Verse . Profile ;
@@ -45,9 +46,14 @@ public static TempGameData SaveAndReload()
4546
4647 mapCmds [ ScheduledCommand . Global ] = Multiplayer . AsyncWorldTime . cmds ;
4748
48- DeepProfiler . Start ( "Multiplayer SaveAndReload: Save" ) ;
49- var gameData = SaveGameData ( ) ;
50- DeepProfiler . End ( ) ;
49+ TempGameData gameData ;
50+ using ( DeepProfilerWrapper . Section ( "Multiplayer SaveAndReload: Save" ) )
51+ {
52+ // When reloading in multifaction always save as the spectator faction to ensure determinism
53+ if ( Multiplayer . GameComp . multifaction )
54+ Multiplayer . game . ChangeRealPlayerFaction ( Multiplayer . WorldComp . spectatorFaction , false ) ;
55+ gameData = SaveGameData ( ) ;
56+ }
5157
5258 MapDrawerRegenPatch . copyFrom = drawers ;
5359 WorldGridCachePatch . copyFrom = worldGridSaved ;
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ public static void Init()
1919 Multiplayer . serialization . AddExplicitImplType ( typeof ( IThingHolder ) ) ;
2020 Multiplayer . serialization . AddExplicitImplType ( typeof ( IReloadableComp ) ) ;
2121 Multiplayer . serialization . AddExplicitImplType ( typeof ( Policy ) ) ;
22- Multiplayer . serialization . AddExplicitImplType ( typeof ( PawnRoleSelectionWidgetBase < ILordJobRole > ) ) ;
22+
23+ // todo for 1.5
24+ // Multiplayer.serialization.AddExplicitImplType(typeof(PawnRoleSelectionWidgetBase<ILordJobRole>));
2325 }
2426}
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ namespace Multiplayer.Common
22{
33 public static class MpVersion
44 {
5- public const string Version = "0.10" ;
6- public const int Protocol = 42 ;
5+ public const string Version = "0.10.1 " ;
6+ public const int Protocol = 43 ;
77
88 public const string ApiAssemblyName = "0MultiplayerAPI" ;
99
You can’t perform that action at this time.
0 commit comments