From 0cc3bcb121b7e40fee49e62633afbc4d4874c7b3 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 2 Sep 2020 14:39:02 -0400 Subject: [PATCH] Fixed #2477 --- core/src/mindustry/logic/LStatement.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/logic/LStatement.java b/core/src/mindustry/logic/LStatement.java index f7e39c6088..cbe5029d94 100644 --- a/core/src/mindustry/logic/LStatement.java +++ b/core/src/mindustry/logic/LStatement.java @@ -93,7 +93,13 @@ public abstract class LStatement{ Core.scene.add(t); t.update(() -> { - if(b.parent == null) return; + if(b.parent == null || !b.isDescendantOf(Core.scene.root)){ + Core.app.post(() -> { + hitter.remove(); + t.remove(); + }); + return; + } b.localToStageCoordinates(Tmp.v1.set(b.getWidth()/2f, b.getHeight()/2f)); t.setPosition(Tmp.v1.x, Tmp.v1.y, Align.center);