Skip to content

Commit

Permalink
work around timewarp mods; fix #1346
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed May 6, 2017
1 parent a6419ad commit 86c2373
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions ksp_plugin_adapter/ksp_plugin_adapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2019,9 +2019,27 @@ private void ResetPlugin() {
}

private void SetRotatingFrameThresholds() {
ApplyToBodyTree(body => body.inverseRotThresholdAltitude =
(float)Math.Max(body.timeWarpAltitudeLimits[1],
body.atmosphereDepth));
ApplyToBodyTree(
body => {
double timewarp_limit = body.timeWarpAltitudeLimits[1];
if (timewarp_limit == 0) {
Log.Warning("The timewarp limit for " + body.theName + " vanishes");
if (body.atmosphereDepth == 0) {
Log.Warning(
body.theName + " is airless, setting the manageability" +
" threshold to 10 km to allow landings");
timewarp_limit = 10e3;
}
}
body.inverseRotThresholdAltitude =
(float)Math.Max(timewarp_limit,
body.atmosphereDepth);
Log.Info("Set manageability threshold for " + body.theName + " to " +
body.inverseRotThresholdAltitude +
" m; its atmosphere extends to " + body.atmosphereDepth +
" m and timewarp is allowed above " +
body.timeWarpAltitudeLimits[1] + " m");
});
}

private void RemoveBuggyTidalLocking() {
Expand Down

0 comments on commit 86c2373

Please sign in to comment.