mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-06 04:08:03 +02:00
Fixed flag resolution algorithm.
This commit is contained in:
parent
d3b8bd6f39
commit
4e2a902b75
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user