From ce2750ba60bd62b5be30472a41cd24709b1b79e0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 8 Feb 2021 16:29:41 -0500 Subject: [PATCH] Rail bullet fix --- core/src/mindustry/entities/Damage.java | 10 +++++++++- core/src/mindustry/entities/bullet/RailBulletType.java | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index e332af5a50..859cec6257 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -116,7 +116,15 @@ public class Damage{ * Only enemies of the specified team are damaged. */ public static void collideLine(Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large){ - length = findLaserLength(hitter, length); + collideLine(hitter, team, effect, x, y, angle, length, large, true); + } + + /** + * Damages entities in a line. + * Only enemies of the specified team are damaged. + */ + public static void collideLine(Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large, boolean laser){ + if(laser) length = findLaserLength(hitter, length); collidedBlocks.clear(); tr.trns(angle, length); diff --git a/core/src/mindustry/entities/bullet/RailBulletType.java b/core/src/mindustry/entities/bullet/RailBulletType.java index aa5136e7fc..a41d326bd8 100644 --- a/core/src/mindustry/entities/bullet/RailBulletType.java +++ b/core/src/mindustry/entities/bullet/RailBulletType.java @@ -54,7 +54,7 @@ public class RailBulletType extends BulletType{ super.init(b); b.fdata = length; - Damage.collideLine(b, b.team, b.type.hitEffect, b.x, b.y, b.rotation(), length, false); + Damage.collideLine(b, b.team, b.type.hitEffect, b.x, b.y, b.rotation(), length, false, false); float resultLen = b.fdata; Vec2 nor = Tmp.v1.set(b.vel).nor();