Skip to content

Commit

Permalink
Clean up Cover VBL checks
Browse files Browse the repository at this point in the history
- Fix RPTools#4437 more directly by not excluding the current island while iterating over siblings.
- Fix facing of current ocean, while removing redundant null check against the parent.
  • Loading branch information
kwvanderlinde committed Nov 23, 2023
1 parent c5eb86b commit e8e6124
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ public boolean addCoverBlocking(AreaTree topology) {
final var parentOcean = island.getParentOcean();

for (final var siblingIsland : parentOcean.getIslands()) {
if (siblingIsland == island) {
continue;
}
addVisionBlockingSegments(siblingIsland, Facing.OCEAN_SIDE_FACES_ORIGIN);
}
for (final var childOcean : island.getOceans()) {
Expand All @@ -248,10 +245,7 @@ public boolean addCoverBlocking(AreaTree topology) {
addVisionBlockingSegments(parentOcean, Facing.OCEAN_SIDE_FACES_ORIGIN);
addVisionBlockingSegments(island, Facing.OCEAN_SIDE_FACES_ORIGIN);
} else if (container instanceof AreaOcean ocean) {
final var parentIsland = ocean.getParentIsland();
if (parentIsland != null) {
addVisionBlockingSegments(ocean, Facing.ISLAND_SIDE_FACES_ORIGIN);
}
addVisionBlockingSegments(ocean, Facing.OCEAN_SIDE_FACES_ORIGIN);

for (var containedIsland : ocean.getIslands()) {
addVisionBlockingSegments(containedIsland, Facing.OCEAN_SIDE_FACES_ORIGIN);
Expand Down

0 comments on commit e8e6124

Please sign in to comment.