From abbc25798d35c0581250aa734355d8e97cba8bb6 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Thu, 9 Sep 2021 12:47:08 -0700 Subject: [PATCH] Pull trail updating out into its own method (#5964) --- .../mindustry/entities/bullet/BulletType.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 213c911a6b..5fc19e4f20 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -346,13 +346,7 @@ public class BulletType extends Content implements Cloneable{ } public void update(Bullet b){ - if(!headless && trailLength > 0){ - if(b.trail == null){ - b.trail = new Trail(trailLength); - } - b.trail.length = trailLength; - b.trail.update(b.x, b.y, trailInterp.apply(b.fin())); - } + updateTrail(b); if(homingPower > 0.0001f && b.time >= homingDelay){ Teamc target; @@ -386,6 +380,16 @@ public class BulletType extends Content implements Cloneable{ } } } + + public void updateTrail(Bullet b){ + if(!headless && trailLength > 0){ + if(b.trail == null){ + b.trail = new Trail(trailLength); + } + b.trail.length = trailLength; + b.trail.update(b.x, b.y, trailInterp.apply(b.fin())); + } + } @Override public void init(){