Fixed flag resolution algorithm.

This commit is contained in:
sk89q 2011-04-02 11:47:14 -07:00
parent d3b8bd6f39
commit 4e2a902b75

View File

@ -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));
}
/**