From 434eb68898b2cd677b60a24ec10ff358824a4d07 Mon Sep 17 00:00:00 2001 From: asofold Date: Mon, 31 Dec 2012 16:29:32 +0100 Subject: [PATCH] Don't count the first tick for lag. --- .../fr/neatmonster/nocheatplus/utilities/TickTask.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/utilities/TickTask.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/utilities/TickTask.java index 7133d251..539820cb 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/utilities/TickTask.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/utilities/TickTask.java @@ -344,9 +344,12 @@ public class TickTask implements Runnable { LogUtil.logSevere("[NoCheatPlus] System time ran backwards (" + timeLast + "->" + time + "), clear all data and history..."); DataManager.clearData(CheckType.ALL); } - else{ + else if (tick > 1){ lastDur = time - timeLast; } + else{ + lastDur = 50; + } // Update sums of sums of tick durations. if (tick > 0 && (tick % lagMaxTicks) == 0){ @@ -364,7 +367,7 @@ public class TickTask implements Runnable { tickDurations[0] = lastDur; // Lag spikes counting. [Subject to adjustments!] - if (lastDur > spikeDurations[0]){ + if (lastDur > spikeDurations[0] && tick > 1){ spikes[0].add(time, 1f); for (int i = 1; i < spikeDurations.length; i++){ if (lastDur > spikeDurations[i]){