Hide blocks outside map border from attack/hovering
This commit is contained in:
@@ -272,6 +272,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
//region utility methods
|
//region utility methods
|
||||||
|
|
||||||
public boolean isDiscovered(Team viewer){
|
public boolean isDiscovered(Team viewer){
|
||||||
|
if(state.rules.borderDarkness && world.getDarkness(tile.x, tile.y) >= 3){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(viewer == null) return true;
|
if(viewer == null) return true;
|
||||||
if(block.size <= 2){
|
if(block.size <= 2){
|
||||||
return fogControl.isDiscovered(viewer, tile.x, tile.y);
|
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;
|
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 x = 0; x < size; x++){
|
||||||
for(int y = 0; y < size; y++){
|
for(int y = 0; y < size; y++){
|
||||||
if(fogControl.isVisibleTile(viewer, tx + x + of, ty + y + of)){
|
if(fogControl.isVisibleTile(viewer, tx + x + of, ty + y + of)){
|
||||||
|
|||||||
Reference in New Issue
Block a user