Fix that that last update didnt actually work (#938)

<!-- A new module or something else important -->

## Major features

-

<!-- A new parameter added to a module, or API feature -->

## Minor features

-

<!-- Some improvement that requires no action on the part of add-on
creators i.e., improved star graphics -->

## Improvements

-

<!-- Be sure to reference the existing issue if it exists -->

## Bug fixes

-
This commit is contained in:
xen-42 2024-09-27 21:58:20 -04:00 committed by GitHub
commit 002c0e6d24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,10 +68,11 @@ namespace NewHorizons.Handlers
RegisterFactForSystem(system.Config.factRequiredForWarp, system.UniqueID);
}
if (system.UniqueID == Main.Instance.CurrentStarSystem && !string.IsNullOrEmpty(system.Config.factRequiredToExitViaWarpDrive))
if (system.UniqueID == Main.Instance.CurrentStarSystem)
{
_factRequiredToExitViaWarpDrive = system.Config.factRequiredToExitViaWarpDrive;
_canExitViaWarpDrive = system.Config.canExitViaWarpDrive || !string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive);
NHLogger.LogVerbose($"In system {system.UniqueID} can exit via warp drive? {system.Config.canExitViaWarpDrive} {_canExitViaWarpDrive} {_factRequiredToExitViaWarpDrive}");
}
}
}
@ -139,7 +140,7 @@ namespace NewHorizons.Handlers
if (Main.Instance.CurrentStarSystem == "SolarSystem")
canExitViaWarpDrive = true;
NHLogger.Log(canEnterViaWarpDrive, canExitViaWarpDrive, system, HasUnlockedSystem(system));
NHLogger.LogVerbose(canEnterViaWarpDrive, canExitViaWarpDrive, system, HasUnlockedSystem(system));
return canWarpTo
&& canEnterViaWarpDrive
@ -152,6 +153,7 @@ namespace NewHorizons.Handlers
{
if (!string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive) && factID == _factRequiredToExitViaWarpDrive)
{
_canExitViaWarpDrive = true;
if (!Main.HasWarpDrive)
{
Main.Instance.EnableWarpDrive();