diff --git a/core/src/mindustry/entities/bullet/RailBulletType.java b/core/src/mindustry/entities/bullet/RailBulletType.java index f10b221c8f..07e1e6dddb 100644 --- a/core/src/mindustry/entities/bullet/RailBulletType.java +++ b/core/src/mindustry/entities/bullet/RailBulletType.java @@ -7,6 +7,9 @@ import mindustry.entities.*; import mindustry.gen.*; public class RailBulletType extends BulletType{ + //for calculating the furthest point + static float furthest = 0; + public Effect pierceEffect = Fx.hitBulletSmall, updateEffect = Fx.none; /** Multiplier of damage decreased per health pierced. */ public float pierceDamageFactor = 1f; @@ -47,6 +50,11 @@ public class RailBulletType extends BulletType{ //subtract health from each consecutive pierce b.damage -= Math.min(b.damage, sub); + + //bullet was stopped, decrease furthest distance + if(b.damage <= 0f){ + furthest = Math.min(furthest, b.dst(pos)); + } } @Override @@ -54,8 +62,9 @@ public class RailBulletType extends BulletType{ super.init(b); b.fdata = length; + furthest = length; Damage.collideLine(b, b.team, b.type.hitEffect, b.x, b.y, b.rotation(), length, false, false); - float resultLen = b.fdata; + float resultLen = furthest; Vec2 nor = Tmp.v1.trns(b.rotation(), 1f).nor(); for(float i = 0; i <= resultLen; i += updateEffectSeg){ diff --git a/gradle.properties b/gradle.properties index 98ad075e46..d6205820f2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works http.socketTimeout=80000 http.connectionTimeout=80000 -archash=2fff3e0fc21546b1a52652c8222faf78847b6991 +archash=83ba08c732333d88d7f46142721cec043d6bbeee