Don't call initialize() on non-cancellable movements.

Fixes WORLDGUARD-3362.
This commit is contained in:
sk89q 2015-02-11 17:12:10 -08:00
parent 91ccb95672
commit 752ccec150
2 changed files with 2 additions and 8 deletions

View File

@ -223,12 +223,6 @@ public Location testMoveTo(Player player, Location to, MoveType moveType, boolea
lastRegionSet = toSet.getRegions(); lastRegionSet = toSet.getRegions();
} }
// Some handlers (see: exit flag) store 'last position data' that
// becomes invalid if we're going to let the player move anyway
if (moveType.isCancellable()) {
resetState(player);
}
return null; return null;
} }

View File

@ -73,7 +73,7 @@ protected boolean onSetValue(Player player, Location from, Location to, Applicab
LocalPlayer localPlayer = getPlugin().wrapPlayer(player); LocalPlayer localPlayer = getPlugin().wrapPlayer(player);
if (allowed && !lastAllowed && !(moveType.isTeleport() && exitViaTeleport)) { if (allowed && !lastAllowed && !(moveType.isTeleport() && exitViaTeleport) && moveType.isCancellable()) {
Boolean override = toSet.queryValue(localPlayer, DefaultFlag.EXIT_OVERRIDE); Boolean override = toSet.queryValue(localPlayer, DefaultFlag.EXIT_OVERRIDE);
if (override == null || !override) { if (override == null || !override) {
sendMessage(player); sendMessage(player);
@ -93,7 +93,7 @@ protected boolean onAbsentValue(Player player, Location from, Location to, Appli
boolean lastAllowed = StateFlag.test(lastValue); boolean lastAllowed = StateFlag.test(lastValue);
if (!lastAllowed) { if (!lastAllowed && moveType.isCancellable()) {
Boolean override = toSet.queryValue(getPlugin().wrapPlayer(player), DefaultFlag.EXIT_OVERRIDE); Boolean override = toSet.queryValue(getPlugin().wrapPlayer(player), DefaultFlag.EXIT_OVERRIDE);
if (override == null || !override) { if (override == null || !override) {
sendMessage(player); sendMessage(player);