diff --git a/src/main/java/com/sk89q/worldguard/session/Session.java b/src/main/java/com/sk89q/worldguard/session/Session.java index 882deedd..fb05e96c 100644 --- a/src/main/java/com/sk89q/worldguard/session/Session.java +++ b/src/main/java/com/sk89q/worldguard/session/Session.java @@ -223,12 +223,6 @@ public Location testMoveTo(Player player, Location to, MoveType moveType, boolea 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; } diff --git a/src/main/java/com/sk89q/worldguard/session/handler/ExitFlag.java b/src/main/java/com/sk89q/worldguard/session/handler/ExitFlag.java index e468942a..45d97414 100644 --- a/src/main/java/com/sk89q/worldguard/session/handler/ExitFlag.java +++ b/src/main/java/com/sk89q/worldguard/session/handler/ExitFlag.java @@ -73,7 +73,7 @@ protected boolean onSetValue(Player player, Location from, Location to, Applicab 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); if (override == null || !override) { sendMessage(player); @@ -93,7 +93,7 @@ protected boolean onAbsentValue(Player player, Location from, Location to, Appli boolean lastAllowed = StateFlag.test(lastValue); - if (!lastAllowed) { + if (!lastAllowed && moveType.isCancellable()) { Boolean override = toSet.queryValue(getPlugin().wrapPlayer(player), DefaultFlag.EXIT_OVERRIDE); if (override == null || !override) { sendMessage(player);