Hide blocks outside map border from attack/hovering

This commit is contained in:
Anuken
2022-10-23 13:06:53 -04:00
parent c3324cd04c
commit e624993ab1

View File

@@ -272,6 +272,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
//region utility methods
public boolean isDiscovered(Team viewer){
if(state.rules.borderDarkness && world.getDarkness(tile.x, tile.y) >= 3){
return false;
}
if(viewer == null) return true;
if(block.size <= 2){
return fogControl.isDiscovered(viewer, tile.x, tile.y);
@@ -1940,6 +1944,8 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
int size = block.size, of = block.sizeOffset, tx = tile.x, ty = tile.y;
if(!isDiscovered(viewer)) return true;
for(int x = 0; x < size; x++){
for(int y = 0; y < size; y++){
if(fogControl.isVisibleTile(viewer, tx + x + of, ty + y + of)){