From e73a813d693cbb4a854fa423ad39f368d9de1ef1 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Thu, 8 Oct 2020 19:27:01 -0700 Subject: [PATCH] prevent from breaking other things --- core/src/mindustry/entities/bullet/BulletType.java | 4 ++-- core/src/mindustry/entities/comp/BulletComp.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 9226f77820..0a6e6c38e7 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -25,7 +25,7 @@ public abstract class BulletType extends Content{ public float drawSize = 40f; public float drag = 0f; public boolean pierce, pierceBuilding; - public int pierceCap = 1; + public int pierceCap = -1; public Effect hitEffect, despawnEffect; /** Effect created when shooting. */ @@ -236,7 +236,7 @@ public abstract class BulletType extends Content{ } public void init(Bullet b){ - if(pierceCap > 1) { + if(pierceCap >= 1) { pierce = true; pierceBuilding = true; } diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index a2a584a063..4deb7cc9dc 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -145,7 +145,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw }); } - if(collided.size >= type.pierceCap) { + if(type.pierceCap != -1 && collided.size >= type.pierceCap) { remove(); } }