From afcf93b7b182967cab928fed8a1a3523c12d710f Mon Sep 17 00:00:00 2001 From: sk89q Date: Tue, 27 Jan 2015 15:21:56 -0800 Subject: [PATCH] Reset handler caches when a move type is non-cancellable. --- src/main/java/com/sk89q/worldguard/session/Session.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/sk89q/worldguard/session/Session.java b/src/main/java/com/sk89q/worldguard/session/Session.java index fb05e96c..882deedd 100644 --- a/src/main/java/com/sk89q/worldguard/session/Session.java +++ b/src/main/java/com/sk89q/worldguard/session/Session.java @@ -223,6 +223,12 @@ 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; }