mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-16 09:06:53 +02:00
Fixed an important bug with the algorithm for handling region priorities.
This commit is contained in:
parent
2277183330
commit
233a2bdbe7
@ -149,7 +149,7 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) {
|
|||||||
allowed = def;
|
allowed = def;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lastPriority = 0;
|
int lastPriority = Integer.MIN_VALUE;
|
||||||
|
|
||||||
// The algorithm is as follows:
|
// The algorithm is as follows:
|
||||||
// While iterating through the list of regions, if an entry disallows
|
// While iterating through the list of regions, if an entry disallows
|
||||||
@ -179,6 +179,8 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastPriority = region.getPriority();
|
||||||
|
|
||||||
// Ignore non-build regions
|
// Ignore non-build regions
|
||||||
if (player != null
|
if (player != null
|
||||||
&& region.getFlag(DefaultFlag.PASSTHROUGH) == State.ALLOW) {
|
&& region.getFlag(DefaultFlag.PASSTHROUGH) == State.ALLOW) {
|
||||||
@ -217,7 +219,6 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
lastPriority = region.getPriority();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return found == false ? def :
|
return found == false ? def :
|
||||||
|
Loading…
Reference in New Issue
Block a user