From 25a1d125c837e242ae8055c781ac6577cd88b9d1 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 20 Jul 2022 15:58:24 -0400 Subject: [PATCH] Fixed #7207 --- core/src/mindustry/entities/comp/BulletComp.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index f26a30a5db..3684cacb34 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -167,7 +167,9 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw //direct hit on correct tile (aimTile != null && aimTile.build == build) || //a piercing bullet overshot the aim tile, it's fine to hit things now - (type.pierce && aimTile != null && Mathf.dst(x, y, originX, originY) > aimTile.dst(originX, originY) + 2f)); + (type.pierce && aimTile != null && Mathf.dst(x, y, originX, originY) > aimTile.dst(originX, originY) + 2f) || + //there was nothing to aim at + (aimX == -1f && aimY == -1f)); } //copy-paste of World#raycastEach, inlined for lambda capture performance.