After enabling exiting via warp drive, only enable if we actually have a system

This commit is contained in:
xen-42 2024-10-04 13:46:06 -04:00
parent aeb08f1480
commit d2f88ed9ad
2 changed files with 7 additions and 2 deletions

View File

@ -211,7 +211,7 @@ namespace NewHorizons.Components.ShipLog
{ {
if (_starSystemCards.Count == 0) if (_starSystemCards.Count == 0)
{ {
NHLogger.LogWarning("Showing star chart mode when there are no avaialble systems"); NHLogger.LogWarning("Showing star chart mode when there are no available systems");
return; return;
} }

View File

@ -156,15 +156,20 @@ namespace NewHorizons.Handlers
_canExitViaWarpDrive = true; _canExitViaWarpDrive = true;
if (!Main.HasWarpDrive) if (!Main.HasWarpDrive)
{ {
Main.Instance.EnableWarpDrive(); var flagActuallyAddedACard = false;
// Add all cards that now work // Add all cards that now work
foreach (var starSystem in Main.SystemDict.Keys) foreach (var starSystem in Main.SystemDict.Keys)
{ {
if (CanWarpToSystem(starSystem)) if (CanWarpToSystem(starSystem))
{ {
ShipLogStarChartMode.AddSystemCard(starSystem); ShipLogStarChartMode.AddSystemCard(starSystem);
flagActuallyAddedACard = true;
} }
} }
if (flagActuallyAddedACard)
{
Main.Instance.EnableWarpDrive();
}
} }
else else
{ {