Fixed an important bug with the algorithm for handling region priorities.

This commit is contained in:
sk89q 2011-06-11 01:20:46 -07:00
parent 2277183330
commit 233a2bdbe7

View File

@ -149,7 +149,7 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) {
allowed = def;
}
int lastPriority = 0;
int lastPriority = Integer.MIN_VALUE;
// The algorithm is as follows:
// While iterating through the list of regions, if an entry disallows
@ -178,6 +178,8 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) {
if (found && region.getPriority() < lastPriority) {
break;
}
lastPriority = region.getPriority();
// Ignore non-build regions
if (player != null
@ -217,7 +219,6 @@ private boolean internalGetState(StateFlag flag, LocalPlayer player) {
}
found = true;
lastPriority = region.getPriority();
}
return found == false ? def :