Fix for strange bug preventing people (sometimes) from walking down

over ledges/stairs.
Changed behaviour if players are allowed to fly but seem to fly too
fast.
This commit is contained in:
Evenprime 2011-07-23 19:42:38 +02:00
parent b8e3aeabd4
commit 6bdec962b2
2 changed files with 15 additions and 12 deletions

View File

@ -3,7 +3,7 @@ name: NoCheat
author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheat
version: 1.11
version: 1.11a
softdepend: [ Permissions, CraftIRC ]

View File

@ -121,6 +121,11 @@ public class MovingCheck extends Check {
if(flyCheck) {
result += Math.max(0D, flyingCheck.check(player, from, fromOnGround, to, toOnGround, data));
}
else
{
// If players are allowed to fly, there's no need to remember the last location on ground
data.setBackPoint = from;
}
if(runCheck) {
result += Math.max(0D, runningCheck.check(from, to,
@ -131,22 +136,20 @@ public class MovingCheck extends Check {
data.jumpPhase++;
if(result <= 0) {
if(fromOnGround) {
data.setBackPoint = from;
data.jumpPhase = 0;
}
else if(toOnGround) {
data.jumpPhase = 0;
}
}
else if(result > 0) {
if(fromOnGround) {
data.setBackPoint = from;
data.jumpPhase = 0;
}
else if(result <= 0 && toOnGround) {
data.jumpPhase = 0;
}
if(result > 0) {
// Increment violation counter
data.violationLevel += result;
if(data.setBackPoint == null) data.setBackPoint = from;
}
if(result > 0 && data.violationLevel > 1) {
setupSummaryTask(player, data);