From 233a2bdbe7a24901b334b9a7d86634e159b35822 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 11 Jun 2011 01:20:46 -0700 Subject: [PATCH] Fixed an important bug with the algorithm for handling region priorities. --- .../com/sk89q/worldguard/protection/ApplicableRegionSet.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java b/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java index d21813b0..1ab961c5 100644 --- a/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java +++ b/src/main/java/com/sk89q/worldguard/protection/ApplicableRegionSet.java @@ -149,7 +149,7 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) { allowed = def; } - int lastPriority = 0; + int lastPriority = Integer.MIN_VALUE; // The algorithm is as follows: // While iterating through the list of regions, if an entry disallows @@ -178,6 +178,8 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) { if (found && region.getPriority() < lastPriority) { break; } + + lastPriority = region.getPriority(); // Ignore non-build regions if (player != null @@ -217,7 +219,6 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) { } found = true; - lastPriority = region.getPriority(); } return found == false ? def :