From 79cac2c4c34734bbf4c347e915006d5b9c03cf94 Mon Sep 17 00:00:00 2001 From: MhaWay Date: Thu, 21 May 2026 23:25:17 +0200 Subject: [PATCH 1/3] Disable unstable join-point live cache rearming --- Source/Client/Saving/SaveLoad.cs | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/Source/Client/Saving/SaveLoad.cs b/Source/Client/Saving/SaveLoad.cs index a625b5669..5c9436688 100644 --- a/Source/Client/Saving/SaveLoad.cs +++ b/Source/Client/Saving/SaveLoad.cs @@ -24,9 +24,7 @@ public static TempGameData SaveAndReload(bool cache = false) { Multiplayer.reloading = true; - var worldGridSaved = Find.WorldGrid; var tweenedPos = new Dictionary(); - var drawers = new Dictionary(); var localFactionId = Multiplayer.RealPlayerFaction.loadID; var mapCmds = new Dictionary>(); var planetRenderMode = Find.World.renderer.wantedMode; @@ -37,8 +35,6 @@ public static TempGameData SaveAndReload(bool cache = false) foreach (Map map in Find.Maps) { - drawers[map.uniqueID] = map.mapDrawer; - foreach (Pawn p in map.mapPawns.AllPawnsSpawned) tweenedPos[p.thingIDNumber] = p.drawer.tweener.tweenedPos; @@ -58,20 +54,15 @@ public static TempGameData SaveAndReload(bool cache = false) gameData = SaveGameData(); } - if (cache) - { - MapDrawerRegenPatch.copyFrom = drawers; - WorldGridCachePatch.copyFrom = worldGridSaved; - WorldGridExposeDataPatch.copyFrom = worldGridSaved; - WorldRendererCachePatch.copyFrom = worldGridSaved; - } - else - { - MapDrawerRegenPatch.copyFrom.Clear(); - WorldGridCachePatch.copyFrom = null; - WorldGridExposeDataPatch.copyFrom = null; - WorldRendererCachePatch.copyFrom = null; - } + // Join-point live caches stay disabled here. + // Reusing render/world objects across reload proved unstable, while the measured gain + // was only about half a second, which is not enough to justify the risk. + // We still clear/null the static holders instead of commenting them out so stale state + // cannot survive if another path ever arms these cache fields again. + MapDrawerRegenPatch.copyFrom.Clear(); + WorldGridCachePatch.copyFrom = null; + WorldGridExposeDataPatch.copyFrom = null; + WorldRendererCachePatch.copyFrom = null; MusicManagerPlay musicManager = null; if (Find.MusicManagerPlay.gameObjectCreated) From ba2d910fce60c6fe921652e5279a43f95f9f2e67 Mon Sep 17 00:00:00 2001 From: MhaWay Date: Thu, 21 May 2026 23:56:00 +0200 Subject: [PATCH 2/3] Remove dead SaveAndReload cache parameter --- Source/Client/Saving/SaveLoad.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Client/Saving/SaveLoad.cs b/Source/Client/Saving/SaveLoad.cs index 5c9436688..3346a7b16 100644 --- a/Source/Client/Saving/SaveLoad.cs +++ b/Source/Client/Saving/SaveLoad.cs @@ -20,7 +20,7 @@ public record TempGameData(XmlDocument SaveData, byte[] SessionData); public static class SaveLoad { - public static TempGameData SaveAndReload(bool cache = false) + public static TempGameData SaveAndReload() { Multiplayer.reloading = true; From ea718a124f51ae46a407daddc957e8ee15b88766 Mon Sep 17 00:00:00 2001 From: MhaWay Date: Thu, 21 May 2026 23:56:39 +0200 Subject: [PATCH 3/3] Remove dead SaveAndReload cache flag --- Source/Client/AsyncTime/AsyncWorldTimeComp.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Client/AsyncTime/AsyncWorldTimeComp.cs b/Source/Client/AsyncTime/AsyncWorldTimeComp.cs index 6be82d6af..b749e2c6e 100644 --- a/Source/Client/AsyncTime/AsyncWorldTimeComp.cs +++ b/Source/Client/AsyncTime/AsyncWorldTimeComp.cs @@ -276,7 +276,7 @@ public void ExecuteCmd(ScheduledCommand cmd) private static void CreateJoinPointAndSendIfHost() { - Multiplayer.session.dataSnapshot = SaveLoad.CreateGameDataSnapshot(SaveLoad.SaveAndReload(true), Multiplayer.GameComp.multifaction); + Multiplayer.session.dataSnapshot = SaveLoad.CreateGameDataSnapshot(SaveLoad.SaveAndReload(), Multiplayer.GameComp.multifaction); if (!TickPatch.Simulating && !Multiplayer.IsReplay) {