From e56b89636515d610a7c7bd7468566599686c3530 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 28 Mar 2025 14:02:33 +0100 Subject: [PATCH] Tweaks to map loading --- Scripts/GlobalState.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Scripts/GlobalState.cs b/Scripts/GlobalState.cs index d66d4d63..0c0ab6ce 100644 --- a/Scripts/GlobalState.cs +++ b/Scripts/GlobalState.cs @@ -98,13 +98,12 @@ public partial class GlobalState : Node private void DeferredGotoScene(string path, MapStartDataResource startData = null) { - // if (InventoryManager.Instance is not null) - // { - // SessionSettings.Items = InventoryManager.Instance.Save(); - // } - // It is now safe to remove the current scene. CurrentScene.Free(); + + //var sceneParent = CurrentScene.GetParent(); + //sceneParent.RemoveChild(CurrentScene); + //sceneParent.QueueFree(); // Load a new scene. var nextScene = GD.Load(path); @@ -128,9 +127,10 @@ public partial class GlobalState : Node DeferredAddStartDataToGameManager(startData); } - if (GameManager.Instance is not null) { - GameManager.Instance.ApplySessionState(SessionSettings); - } + // Do not do this here because it might get the old gamemanager instead + // if (GameManager.Instance is not null) { + // GameManager.Instance.ApplySessionState(SessionSettings); + // } FadeIn(); }