diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index a62afaf8cd..b08d5d0c5f 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1995,6 +1995,13 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, 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 if(!headless){ if(sound != null){ diff --git a/core/src/mindustry/graphics/BlockRenderer.java b/core/src/mindustry/graphics/BlockRenderer.java index b19c2cdac6..46d21617ce 100644 --- a/core/src/mindustry/graphics/BlockRenderer.java +++ b/core/src/mindustry/graphics/BlockRenderer.java @@ -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; for(int x = 0; x < size; x++){ diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 1ea5eb6d32..98d9332423 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -489,7 +489,7 @@ public class ServerControl implements ApplicationListener{ }); handler.register("pause", "", "Pause or unpause the game.", arg -> { - if(!state.isMenu()){ + if(state.isMenu()){ err("Cannot pause without a game running."); return; }