Revert "Add member inheritance for non-player associables"

This reverts commit b1cd1303d1.
This commit is contained in:
wizjany 2021-07-25 23:31:44 -04:00
parent b1cd1303d1
commit 8efc2e6539
2 changed files with 19 additions and 23 deletions

View File

@ -87,35 +87,31 @@ private boolean checkNonplayerProtectionDomains(Iterable<? extends ProtectedRegi
public Association getAssociation(List<ProtectedRegion> regions) {
checkNotNull(source);
for (ProtectedRegion region : regions) {
while (region != null) {
if ((region.getId().equals(ProtectedRegion.GLOBAL_REGION) && source.isEmpty())) {
return Association.OWNER;
}
if ((region.getId().equals(ProtectedRegion.GLOBAL_REGION) && source.isEmpty())) {
return Association.OWNER;
}
if (source.contains(region)) {
if (useMaxPriorityAssociation) {
int priority = region.getPriority();
if (priority == maxPriority) {
return Association.OWNER;
}
} else {
if (source.contains(region)) {
if (useMaxPriorityAssociation) {
int priority = region.getPriority();
if (priority == maxPriority) {
return Association.OWNER;
}
}
Set<ProtectedRegion> source;
if (useMaxPriorityAssociation) {
source = maxPriorityRegions;
} else {
source = this.source;
}
if (checkNonplayerProtectionDomains(source, region.getFlag(Flags.NONPLAYER_PROTECTION_DOMAINS))) {
return Association.OWNER;
}
}
region = region.getParent();
Set<ProtectedRegion> source;
if (useMaxPriorityAssociation) {
source = maxPriorityRegions;
} else {
source = this.source;
}
if (checkNonplayerProtectionDomains(source, region.getFlag(Flags.NONPLAYER_PROTECTION_DOMAINS))) {
return Association.OWNER;
}
}

View File

@ -212,7 +212,7 @@ public void testNonPlayerBuildAccessInOneRegion(boolean useMaxPriorityAssociatio
assertTrue(appl.testState(assoc, Flags.BUILD));
// Inside fountain
appl = manager.getApplicableRegions(inFountain);
assertTrue(appl.testState(assoc, Flags.BUILD));
assertFalse(appl.testState(assoc, Flags.BUILD));
}
@ParameterizedTest(name = "useMaxPriorityAssociation={0}")