From 6a3638c3c2a1d9ee2ba0e25989de09effffef539 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 18 Apr 2023 10:10:11 -0400 Subject: [PATCH] Fixed #8513 --- core/src/mindustry/entities/bullet/BulletType.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index e749c99058..2e98d4e539 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -394,9 +394,9 @@ public class BulletType extends Content implements Cloneable{ } public void handlePierce(Bullet b, float initialHealth, float x, float y){ - float sub = Math.max(initialHealth*pierceDamageFactor, 0); + float sub = Mathf.zero(pierceDamageFactor) ? 0f : Math.max(initialHealth * pierceDamageFactor, 0); //subtract health from each consecutive pierce - b.damage -= Math.min(b.damage, sub); + b.damage -= Float.isNaN(sub) ? b.damage : Math.min(b.damage, sub); if(removeAfterPierce && b.damage <= 0){ b.hit = true;