mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +01:00
Assume maximally 20 attacks / moves per second.
This commit is contained in:
parent
acd8afcdc2
commit
562f1da59b
@ -115,7 +115,7 @@ public class FightListener extends CheckListener {
|
|||||||
// TODO: Maybe use 3d distance if dy(normalized) is too big.
|
// TODO: Maybe use 3d distance if dy(normalized) is too big.
|
||||||
targetMove = CheckUtils.distance(data.lastAttackedX, data.lastAttackedZ, targetLoc.getX(), targetLoc.getZ());
|
targetMove = CheckUtils.distance(data.lastAttackedX, data.lastAttackedZ, targetLoc.getX(), targetLoc.getZ());
|
||||||
msAge = (long) (50f * TickTask.getLag(50L * tickAge) * (float) tickAge);
|
msAge = (long) (50f * TickTask.getLag(50L * tickAge) * (float) tickAge);
|
||||||
normalizedMove = msAge == 0 ? targetMove : targetMove * 1000.0 / (double) msAge;
|
normalizedMove = msAge == 0 ? targetMove : targetMove * Math.max(20.0, 1000.0 / (double) msAge);
|
||||||
}
|
}
|
||||||
// TODO: calculate factor for dists: ticks * 50 * lag
|
// TODO: calculate factor for dists: ticks * 50 * lag
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user