From 512951e8ec1dba3f282983a6cee451c47af80b2c Mon Sep 17 00:00:00 2001 From: xen-42 Date: Fri, 27 Sep 2024 15:46:15 -0400 Subject: [PATCH] Fix warp drive breaking --- NewHorizons/Handlers/StarChartHandler.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Handlers/StarChartHandler.cs b/NewHorizons/Handlers/StarChartHandler.cs index 3e4c53dd..e0ed3585 100644 --- a/NewHorizons/Handlers/StarChartHandler.cs +++ b/NewHorizons/Handlers/StarChartHandler.cs @@ -59,6 +59,8 @@ namespace NewHorizons.Handlers _starSystemToFactID = new Dictionary(); _factIDToStarSystem = new Dictionary(); + _factRequiredToExitViaWarpDrive = string.Empty; + foreach (NewHorizonsSystem system in _systems) { if (system.Config.factRequiredForWarp != default && system.UniqueID != "SolarSystem") @@ -112,8 +114,8 @@ namespace NewHorizons.Handlers return ShipLogHandler.KnowsFact(factID); } - public static bool CanExitViaWarpDrive() => _canExitViaWarpDrive - && (string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive) || ShipLogHandler.KnowsFact(_factRequiredToExitViaWarpDrive)); + public static bool CanExitViaWarpDrive() => Main.Instance.CurrentStarSystem == "SolarSystem" || (_canExitViaWarpDrive + && (string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive) || ShipLogHandler.KnowsFact(_factRequiredToExitViaWarpDrive))); /// /// Is it actually a valid warp target