Fog placement fixc

This commit is contained in:
Anuken
2022-04-09 13:28:44 -04:00
parent 5d79ad9363
commit 8884491e46
3 changed files with 10 additions and 7 deletions

View File

@@ -100,6 +100,15 @@ public final class FogControl implements CustomChunk{
return fog == null || fog[team.id] == null ? null : fog[team.id].staticData;
}
public boolean isDiscovered(Team team, int x, int y){
if(!state.rules.staticFog || team.isAI()) return true;
var data = getDiscovered(team);
if(data == null) return false;
if(x < 0 || y < 0 || x >= ww || y >= wh) return false;
return data.get(x + y * ww);
}
public boolean isVisible(Team team, float x, float y){
return isVisibleTile(team, World.toTile(x), World.toTile(y));
}