Skip to content

Commit

Permalink
get rid of unneeded checks
Browse files Browse the repository at this point in the history
  • Loading branch information
steamport committed Jun 17, 2019
1 parent ef5cfc9 commit bf7081f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/Kerbalism/Lib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,13 @@ public static UInt32 Hash32(string s)
// return hours in a day
public static double HoursInDay()
{
if (!FlightGlobals.ready) return GameSettings.KERBIN_TIME ? 6.0 : 24.0;
var homeBody = FlightGlobals.GetHomeBody();
return Math.Round(homeBody.rotationPeriod / 3600, 0);
}

// return year length
public static double DaysInYear()
{
if (!FlightGlobals.ready) return 426.0;
return Math.Floor(FlightGlobals.GetHomeBody().orbit.period / (HoursInDay() * 60.0 * 60.0));
}

Expand Down

0 comments on commit bf7081f

Please sign in to comment.