Skip to content

Commit

Permalink
Do not run extra volume check in proc avi window for ROT probe cores
Browse files Browse the repository at this point in the history
(cherry picked from commit 5d1a9e4)
  • Loading branch information
siimav authored and NathanKell committed Jun 3, 2023
1 parent e742b31 commit 609b8d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Avionics/ProceduralAvionicsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,16 @@ private void ApplyAvionicsSettings(bool shouldSeekVolume)
_sControllableMass = $"{controllableMass:0.###}";
return;
}
if (!float.TryParse(_sExtraVolume, out float extraVolumeLiters) || extraVolumeLiters < 0)

float extraVolumeLiters = 0;
bool canSeekVolume = _seekVolumeMethod != null && _seekVolumeMethod.GetParameters().Length == 2;
if (canSeekVolume && (!float.TryParse(_sExtraVolume, out extraVolumeLiters) || extraVolumeLiters < 0))
{
ScreenMessages.PostScreenMessage("Invalid Additional volume value");
_sExtraVolume = "0";
return;
}

if (!float.TryParse(_sECAmount, out float ecAmount) || ecAmount <= 0)
{
ScreenMessages.PostScreenMessage("EC amount needs to be larger than 0");
Expand All @@ -339,7 +343,6 @@ private void ApplyAvionicsSettings(bool shouldSeekVolume)
}

controllableMass = newControlMass;
bool canSeekVolume = _seekVolumeMethod != null && _seekVolumeMethod.GetParameters().Length == 2;
if (shouldSeekVolume && canSeekVolume)
{
// Store and sum together the volume of all resources other than EC on this part
Expand Down

0 comments on commit 609b8d1

Please sign in to comment.