Dont add timeloopcontroller to base system (#804)

## Bug fixes
- Stops time loop from still happening when the ATP is disabled #796
This commit is contained in:
xen-42 2024-03-12 16:21:03 -04:00 committed by GitHub
commit b00aaa6d96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,9 @@ namespace NewHorizons.Components
public void Update() 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 // Stock gives like 33 seconds after the sun collapses
if (_supernovaHappened && Time.time > _supernovaTime + 50f) if (_supernovaHappened && Time.time > _supernovaTime + 50f)
{ {

View File

@ -34,7 +34,8 @@ namespace NewHorizons.Handlers
if (Main.Instance.CurrentStarSystem == "EyeOfTheUniverse") return; if (Main.Instance.CurrentStarSystem == "EyeOfTheUniverse") return;
// Small mod compat change for StopTime - do nothing if it's enabled // 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"); var timeLoopController = new GameObject("TimeLoopController");
timeLoopController.AddComponent<TimeLoopController>(); timeLoopController.AddComponent<TimeLoopController>();