Fix warp drive breaking

This commit is contained in:
xen-42 2024-09-27 15:46:15 -04:00
parent a977de0c30
commit 512951e8ec

View File

@ -59,6 +59,8 @@ namespace NewHorizons.Handlers
_starSystemToFactID = new Dictionary<string, string>(); _starSystemToFactID = new Dictionary<string, string>();
_factIDToStarSystem = new Dictionary<string, string>(); _factIDToStarSystem = new Dictionary<string, string>();
_factRequiredToExitViaWarpDrive = string.Empty;
foreach (NewHorizonsSystem system in _systems) foreach (NewHorizonsSystem system in _systems)
{ {
if (system.Config.factRequiredForWarp != default && system.UniqueID != "SolarSystem") if (system.Config.factRequiredForWarp != default && system.UniqueID != "SolarSystem")
@ -112,8 +114,8 @@ namespace NewHorizons.Handlers
return ShipLogHandler.KnowsFact(factID); return ShipLogHandler.KnowsFact(factID);
} }
public static bool CanExitViaWarpDrive() => _canExitViaWarpDrive public static bool CanExitViaWarpDrive() => Main.Instance.CurrentStarSystem == "SolarSystem" || (_canExitViaWarpDrive
&& (string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive) || ShipLogHandler.KnowsFact(_factRequiredToExitViaWarpDrive)); && (string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive) || ShipLogHandler.KnowsFact(_factRequiredToExitViaWarpDrive)));
/// <summary> /// <summary>
/// Is it actually a valid warp target /// Is it actually a valid warp target