From 86f889fef85f85d00a214115cbedc31848a1ad05 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Sat, 5 Oct 2024 22:13:11 -0400 Subject: [PATCH] Disable time loop is AWC removed --- NewHorizons/Handlers/HeldItemHandler.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/NewHorizons/Handlers/HeldItemHandler.cs b/NewHorizons/Handlers/HeldItemHandler.cs index 4ef2bd82..ef61cd3f 100644 --- a/NewHorizons/Handlers/HeldItemHandler.cs +++ b/NewHorizons/Handlers/HeldItemHandler.cs @@ -19,6 +19,8 @@ public static class HeldItemHandler /// private static Dictionary> _pathOfItemTakenFromSystem = new(); + public static bool WasAWCTakenFromATP => _pathOfItemTakenFromSystem.TryGetValue("SolarSystem", out var list) && list.Contains(ADVANCED_WARP_CORE); + private static GameObject _currentlyHeldItem; /// @@ -43,6 +45,12 @@ public static class HeldItemHandler _currentStarSystem = Main.Instance.CurrentStarSystem; + // If we took the AWC out of the main system make sure to disable time loop + if (_currentStarSystem != "SolarSystem" && WasAWCTakenFromATP) + { + TimeLoop.SetTimeLoopEnabled(false); + } + if (!_isInitialized) { _isInitialized = true; @@ -127,6 +135,7 @@ public static class HeldItemHandler { foreach (var path in paths) { + // Have to wait two frames for the sockets to Awake and Start Delay.FireInNUpdates(() => { try