Don't count the first tick for lag.

This commit is contained in:
asofold 2012-12-31 16:29:32 +01:00
parent 9e839b561e
commit 434eb68898

View File

@ -344,9 +344,12 @@ public class TickTask implements Runnable {
LogUtil.logSevere("[NoCheatPlus] System time ran backwards (" + timeLast + "->" + time + "), clear all data and history..."); LogUtil.logSevere("[NoCheatPlus] System time ran backwards (" + timeLast + "->" + time + "), clear all data and history...");
DataManager.clearData(CheckType.ALL); DataManager.clearData(CheckType.ALL);
} }
else{ else if (tick > 1){
lastDur = time - timeLast; lastDur = time - timeLast;
} }
else{
lastDur = 50;
}
// Update sums of sums of tick durations. // Update sums of sums of tick durations.
if (tick > 0 && (tick % lagMaxTicks) == 0){ if (tick > 0 && (tick % lagMaxTicks) == 0){
@ -364,7 +367,7 @@ public class TickTask implements Runnable {
tickDurations[0] = lastDur; tickDurations[0] = lastDur;
// Lag spikes counting. [Subject to adjustments!] // Lag spikes counting. [Subject to adjustments!]
if (lastDur > spikeDurations[0]){ if (lastDur > spikeDurations[0] && tick > 1){
spikes[0].add(time, 1f); spikes[0].add(time, 1f);
for (int i = 1; i < spikeDurations.length; i++){ for (int i = 1; i < spikeDurations.length; i++){
if (lastDur > spikeDurations[i]){ if (lastDur > spikeDurations[i]){