Keep the drift ratio between .01 and 10 for timer siestas and fiestas

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@468 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Charlie Groves
2008-04-18 19:01:44 +00:00
parent 05cd1b4048
commit ab5729654c
@@ -127,7 +127,8 @@ public abstract class CalibratingTimer
_driftRatio = 1.0;
} else if (drift > MAX_ALLOWED_DRIFT_RATIO || drift < MIN_ALLOWED_DRIFT_RATIO) {
Log.warning("Calibrating [drift=" + drift + "]");
_driftRatio = drift;
// Keep the drift somewhat sane between .01 and 10
_driftRatio = Math.min(Math.max(.01, drift), 10);
if (Math.abs(drift - 1.0) > Math.abs(_maxDriftRatio - 1.0)) {
_maxDriftRatio = drift;
}