From 2c6b2a6fa9e3d53e1b052489a6843bcc3dc58317 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 18 Jul 2022 10:01:24 -0400 Subject: [PATCH] Fixed #7193 --- .../type/weapons/RepairBeamWeapon.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/src/mindustry/type/weapons/RepairBeamWeapon.java b/core/src/mindustry/type/weapons/RepairBeamWeapon.java index e29bbcff20..6e96d1fad1 100644 --- a/core/src/mindustry/type/weapons/RepairBeamWeapon.java +++ b/core/src/mindustry/type/weapons/RepairBeamWeapon.java @@ -162,16 +162,18 @@ public class RepairBeamWeapon extends Weapon{ HealBeamMount heal = (HealBeamMount)mount; - float - weaponRotation = unit.rotation - 90, - wx = unit.x + Angles.trnsx(weaponRotation, x, y), - wy = unit.y + Angles.trnsy(weaponRotation, x, y); + if(unit.canShoot()){ + float + weaponRotation = unit.rotation - 90, + wx = unit.x + Angles.trnsx(weaponRotation, x, y), + wy = unit.y + Angles.trnsy(weaponRotation, x, y); - float z = Draw.z(); - RepairTurret.drawBeam(wx, wy, unit.rotation + mount.rotation, shootY, unit.id, mount.target == null || controllable ? null : (Sized)mount.target, unit.team, heal.strength, - pulseStroke, pulseRadius, beamWidth + Mathf.absin(widthSinScl, widthSinMag), heal.lastEnd, heal.offset, laserColor, laserTopColor, - laser, laserEnd, laserTop, laserTopEnd); - Draw.z(z); + float z = Draw.z(); + RepairTurret.drawBeam(wx, wy, unit.rotation + mount.rotation, shootY, unit.id, mount.target == null || controllable ? null : (Sized)mount.target, unit.team, heal.strength, + pulseStroke, pulseRadius, beamWidth + Mathf.absin(widthSinScl, widthSinMag), heal.lastEnd, heal.offset, laserColor, laserTopColor, + laser, laserEnd, laserTop, laserTopEnd); + Draw.z(z); + } } @Override