From 4e2a902b75f5be5d614430753bb8fdcecff8ff39 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 2 Apr 2011 11:47:14 -0700 Subject: [PATCH] Fixed flag resolution algorithm. --- .../sk89q/worldguard/protection/ApplicableRegionSet.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/com/sk89q/worldguard/protection/ApplicableRegionSet.java b/src/com/sk89q/worldguard/protection/ApplicableRegionSet.java index 19061b36..d1908982 100644 --- a/src/com/sk89q/worldguard/protection/ApplicableRegionSet.java +++ b/src/com/sk89q/worldguard/protection/ApplicableRegionSet.java @@ -127,7 +127,7 @@ public boolean isMemberOfAll(LocalPlayer player) { private boolean internalGetState(StateFlag flag, LocalPlayer player) { boolean found = false; boolean allowed = false; // Used for ALLOW override - boolean def = false; + boolean def = flag.getDefault(); // Handle defaults if (globalRegion != null) { @@ -137,9 +137,6 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) { if (globalState != null) { def = (globalState == State.ALLOW); } - } else { - // There is no global region, so let's use the hard-coded default - def = flag.getDefault(); } // The player argument is used if and only if the flag is the build @@ -222,8 +219,8 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) { lastPriority = region.getPriority(); } - return (found == false ? def : allowed) - || (player != null && needsClear.size() == 0); + return found == false ? def : + (allowed || (player != null && needsClear.size() == 0)); } /**