mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-02 17:09:35 +01: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) {
|
private boolean internalGetState(StateFlag flag, LocalPlayer player) {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
boolean allowed = false; // Used for ALLOW override
|
boolean allowed = false; // Used for ALLOW override
|
||||||
boolean def = false;
|
boolean def = flag.getDefault();
|
||||||
|
|
||||||
// Handle defaults
|
// Handle defaults
|
||||||
if (globalRegion != null) {
|
if (globalRegion != null) {
|
||||||
@ -137,9 +137,6 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) {
|
|||||||
if (globalState != null) {
|
if (globalState != null) {
|
||||||
def = (globalState == State.ALLOW);
|
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
|
// 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();
|
lastPriority = region.getPriority();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (found == false ? def : allowed)
|
return found == false ? def :
|
||||||
|| (player != null && needsClear.size() == 0);
|
(allowed || (player != null && needsClear.size() == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user