Possible minimap fog update fix for servers

This commit is contained in:
Anuken
2022-11-04 15:14:06 -04:00
parent 13d726108b
commit f9d7c172c4
3 changed files with 9 additions and 2 deletions
@@ -1995,6 +1995,13 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
enabled = false; enabled = false;
} }
if(!headless && !wasVisible && state.rules.fog && !inFogTo(player.team())){
visibleFlags |= (1L << player.team().id);
wasVisible = true;
renderer.blocks.updateShadow(self());
renderer.minimap.update(tile);
}
//TODO separate system for sound? AudioSource, etc //TODO separate system for sound? AudioSource, etc
if(!headless){ if(!headless){
if(sound != null){ if(sound != null){
@@ -485,7 +485,7 @@ public class BlockRenderer{
} }
} }
void updateShadow(Building build){ public void updateShadow(Building build){
int size = build.block.size, of = build.block.sizeOffset, tx = build.tile.x, ty = build.tile.y; int size = build.block.size, of = build.block.sizeOffset, tx = build.tile.x, ty = build.tile.y;
for(int x = 0; x < size; x++){ for(int x = 0; x < size; x++){
@@ -489,7 +489,7 @@ public class ServerControl implements ApplicationListener{
}); });
handler.register("pause", "<on/off>", "Pause or unpause the game.", arg -> { handler.register("pause", "<on/off>", "Pause or unpause the game.", arg -> {
if(!state.isMenu()){ if(state.isMenu()){
err("Cannot pause without a game running."); err("Cannot pause without a game running.");
return; return;
} }