Fixed a rare exception in moving check if a teleport destination

isn't in the same world as the player.
This commit is contained in:
Evenprime 2011-07-04 00:27:57 +02:00
parent 272f2d410c
commit 9406961f05
2 changed files with 9 additions and 6 deletions

View File

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

View File

@ -396,12 +396,15 @@ public class MovingCheck extends Check {
// in the move event) tells us if the server is still waiting for the clientside teleporting // in the move event) tells us if the server is still waiting for the clientside teleporting
// to be executed. We are only interested in client's move events after it executed the // to be executed. We are only interested in client's move events after it executed the
// teleport, therefore just ignore all events before that. // teleport, therefore just ignore all events before that.
if(data.teleportTo != null && data.teleportTo.distanceSquared(from) < 0.01D) { if(data.teleportTo != null && data.teleportTo.getWorld().equals(from.getWorld())) {
return true; if(data.teleportTo.distanceSquared(from) < 0.01D) {
} return true;
else { }
data.teleportTo = null; else {
data.teleportTo = null;
}
} }
// Dead or in vehicles -> I don't care // Dead or in vehicles -> I don't care
if(player.isDead() || data.insideVehicle || player.isInsideVehicle()) { if(player.isDead() || data.insideVehicle || player.isInsideVehicle()) {
return true; return true;