diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 202a73d7e0..a824c3a5ff 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -185,8 +185,15 @@ public abstract class BulletType extends Content{ } } - public void hitEntity(Bullet b, Hitboxc other, float initialHealth){ + public void hitEntity(Bullet b, Hitboxc entity, float initialHealth){ + if(entity instanceof Healthc h){ + h.damage(b.damage); + } + if(entity instanceof Unit unit){ + unit.impulse(Tmp.v3.set(unit).sub(b.x, b.y).nor().scl(knockback * 80f)); + unit.apply(status, statusDuration); + } } public void hit(Bullet b){ diff --git a/core/src/mindustry/entities/bullet/RailBulletType.java b/core/src/mindustry/entities/bullet/RailBulletType.java index a41d326bd8..bb833669ac 100644 --- a/core/src/mindustry/entities/bullet/RailBulletType.java +++ b/core/src/mindustry/entities/bullet/RailBulletType.java @@ -71,6 +71,7 @@ public class RailBulletType extends BulletType{ @Override public void hitEntity(Bullet b, Hitboxc entity, float initialHealth){ handle(b, entity, initialHealth); + super.hitEntity(b, entity, initialHealth); } @Override diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index 7f3d42d4e0..a61ecc4d39 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -93,12 +93,6 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw if(other instanceof Healthc h){ health = h.health(); - h.damage(damage); - } - - if(other instanceof Unit unit){ - unit.impulse(Tmp.v3.set(unit).sub(this.x, this.y).nor().scl(type.knockback * 80f)); - unit.apply(type.status, type.statusDuration); } //must be last.