Fog building view fix

This commit is contained in:
Anuken
2022-03-01 12:37:12 -05:00
parent 4574d0501d
commit 84837e0c0f
2 changed files with 4 additions and 4 deletions

View File

@@ -98,10 +98,10 @@ public final class FogControl implements CustomChunk{
}
public boolean isVisibleTile(Team team, int x, int y){
if(!state.rules.fog) return true;
if(!state.rules.fog || team.isAI()) return true;
var data = data(team);
if(data == null) return true;
if(data == null) return false;
if(x < 0 || y < 0 || x >= ww || y >= wh) return false;
return data.read.get(x + y * ww);
}

View File

@@ -256,8 +256,8 @@ public class MinimapRenderer{
}
private Block realBlock(Tile tile){
//TODO dynamically update on visibility change; right now it's just entirely hidden
return tile.build == null ? tile.block() : state.rules.fog && tile.build.team != player.team() ? Blocks.air : tile.block();
//TODO doesn't work properly until player goes and looks at block
return tile.build == null ? tile.block() : state.rules.fog && tile.build.inFogTo(player.team()) ? Blocks.air : tile.block();
}
private int colorFor(Tile tile){