From 13b28fa372d18bc8a9c05c9fe69a912edadf0602 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 12 Mar 2024 12:57:16 -0400 Subject: [PATCH] Dont add timeloopcontroller to base system --- NewHorizons/Components/TimeLoopController.cs | 3 +++ NewHorizons/Handlers/SystemCreationHandler.cs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Components/TimeLoopController.cs b/NewHorizons/Components/TimeLoopController.cs index 7110e6db..fd38ab3c 100644 --- a/NewHorizons/Components/TimeLoopController.cs +++ b/NewHorizons/Components/TimeLoopController.cs @@ -13,6 +13,9 @@ namespace NewHorizons.Components public void Update() { + // So that mods can turn the time loop on/off using the TimLoop.SetTimeLoopEnabled method + if (!TimeLoop._timeLoopEnabled) return; + // Stock gives like 33 seconds after the sun collapses if (_supernovaHappened && Time.time > _supernovaTime + 50f) { diff --git a/NewHorizons/Handlers/SystemCreationHandler.cs b/NewHorizons/Handlers/SystemCreationHandler.cs index debd14e7..5936434a 100644 --- a/NewHorizons/Handlers/SystemCreationHandler.cs +++ b/NewHorizons/Handlers/SystemCreationHandler.cs @@ -34,7 +34,8 @@ namespace NewHorizons.Handlers if (Main.Instance.CurrentStarSystem == "EyeOfTheUniverse") return; // Small mod compat change for StopTime - do nothing if it's enabled - if (system.Config.enableTimeLoop && !OtherModUtil.IsEnabled("_nebula.StopTime")) + // Do not add our custom time loop controller in the base game system: It will handle itself + if (Main.Instance.CurrentStarSystem != "SolarSystem" && system.Config.enableTimeLoop && !OtherModUtil.IsEnabled("_nebula.StopTime")) { var timeLoopController = new GameObject("TimeLoopController"); timeLoopController.AddComponent();