From f01471775c62f929d3272c8ed660c9aa1d416f9b Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 28 Jun 2022 20:45:49 -0400 Subject: [PATCH] Move OnStarSystemLoaded to not be on wake up --- NewHorizons/Main.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index dd54e53d..3b10c960 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -198,15 +198,6 @@ namespace NewHorizons private static void OnWakeUp() { IsSystemReady = true; - try - { - Logger.Log($"Star system loaded [{Instance.CurrentStarSystem}]"); - Instance.OnStarSystemLoaded?.Invoke(Instance.CurrentStarSystem); - } - catch (Exception e) - { - Logger.LogError($"Exception thrown when invoking star system loaded event with parameter [{Instance.CurrentStarSystem}] : {e.GetType().FullName} {e.Message} {e.StackTrace}"); - } } private void OnSceneUnloaded(Scene scene) @@ -302,6 +293,16 @@ namespace NewHorizons // Fix the map satellite SearchUtilities.Find("HearthianMapSatellite_Body", false).AddComponent(); + + try + { + Logger.Log($"Star system loaded [{Instance.CurrentStarSystem}]"); + Instance.OnStarSystemLoaded?.Invoke(Instance.CurrentStarSystem); + } + catch (Exception e) + { + Logger.LogError($"Exception thrown when invoking star system loaded event with parameter [{Instance.CurrentStarSystem}] : {e.GetType().FullName} {e.Message} {e.StackTrace}"); + } } else {