Accoutn for lag in chat.commands.

This commit is contained in:
asofold 2013-01-23 03:07:17 +01:00
parent cce67ac67c
commit 6a70f0a010

View File

@ -47,10 +47,16 @@ public class Commands extends Check {
data.commandsShortTermWeight = 1.0;
}
else if (tick - data.commandsShortTermTick < cc.commandsShortTermTicks){
// TODO: account for lag.
if (!cc.lag || TickTask.getLag(50L * (tick - data.commandsShortTermTick), true) < 1.3f){
// Add up.
data.commandsShortTermWeight += weight;
}
else{
// Reset, too much lag.
data.commandsShortTermTick = tick;
data.commandsShortTermWeight = 1.0;
}
}
else{
// Reset.
data.commandsShortTermTick = tick;