From e0b1c49e0b108b255873babeba51f35c85e270c7 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Thu, 30 Sep 2021 14:01:24 -0700 Subject: [PATCH] Fix weapon recoiling (#6083) Weapons recoil when the begin charging --- core/src/mindustry/type/Weapon.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index fe3bbda604..43b1091312 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -346,6 +346,7 @@ public class Weapon implements Cloneable{ unit.vel.add(Tmp.v1.trns(rotation + 180f, ammo.recoil)); Effect.shake(shake, shake, shootX, shootY); + mount.recoil = recoil; mount.heat = 1f; if(!continuous){ shootSound.at(shootX, shootY, Mathf.random(soundPitchMin, soundPitchMax)); @@ -355,10 +356,10 @@ public class Weapon implements Cloneable{ }else{ unit.vel.add(Tmp.v1.trns(rotation + 180f, ammo.recoil)); Effect.shake(shake, shake, shootX, shootY); + mount.recoil = recoil; mount.heat = 1f; } - mount.recoil = recoil; ejectEffect.at(mountX, mountY, rotation * side); ammo.shootEffect.at(shootX, shootY, rotation, parentize ? unit : null); ammo.smokeEffect.at(shootX, shootY, rotation, parentize ? unit : null);