Skip to content

Commit

Permalink
ETA:APOAPSIS now returns 0 on hyerbolic orbits, as specified by the d…
Browse files Browse the repository at this point in the history
…ocs.

Resolves #2229.
  • Loading branch information
ThunderousEcho committed Nov 12, 2019
1 parent a4db9d9 commit 00fa352
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/kOS/Suffixed/VesselEta.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using kOS.Safe.Encapsulation;
using kOS.Safe.Encapsulation;
using kOS.Safe.Encapsulation.Suffixes;

namespace kOS.Suffixed
Expand All @@ -21,7 +21,8 @@ private void InitializeSuffixEta()
}
public ScalarValue GetApoapsis()
{
return shared.Vessel.orbit.timeToAp;
var timeToAp = shared.Vessel.orbit.timeToAp;
return double.IsInfinity(timeToAp) ? 0 : timeToAp;
}

public ScalarValue GetPeriapsis()
Expand Down

0 comments on commit 00fa352

Please sign in to comment.