Do account for ms == 0.

This commit is contained in:
asofold 2013-01-23 02:21:09 +01:00
parent fdb58eefca
commit 60114eb6eb

View File

@ -236,7 +236,8 @@ public class TickTask implements Runnable {
}
final int tick = TickTask.tick;
if (tick == 0) return 1f;
final int add = (ms % 50) == 0 ? 0 : 1;
final int add = ms > 0 && (ms % 50) == 0 ? 0 : 1;
// TODO: Consider: Put "exact" block here, subtract a tick if appropriate?
final int totalTicks = Math.min(tick, add + (int) (ms / 50));
final int maxTick = Math.min(lagMaxTicks, totalTicks);
long sum = tickDurations[maxTick - 1];