diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 43b5c42203..50d8c4d6e4 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -408,6 +408,7 @@ public class Weapon implements Cloneable{ angle = angleOffset + shootAngle + Mathf.range(inaccuracy); mount.bullet = bullet.create(unit, unit.team, bulletX, bulletY, angle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, mount.aimX, mount.aimY); + handleBullet(unit, mount, mount.bullet); if(!continuous){ shootSound.at(bulletX, bulletY, Mathf.random(soundPitchMin, soundPitchMax)); @@ -423,6 +424,11 @@ public class Weapon implements Cloneable{ mount.heat = 1f; } + //override to do special things to a bullet after spawning + protected void handleBullet(Unit unit, WeaponMount mount, Bullet bullet){ + + } + public void flip(){ x *= -1; shootX *= -1;