Fixed negative recoil

This commit is contained in:
Anuken
2021-10-06 13:29:31 -04:00
parent 60a430025a
commit d43157fd22
+1 -1
View File
@@ -200,7 +200,7 @@ public class Weapon implements Cloneable{
boolean can = unit.canShoot(); boolean can = unit.canShoot();
float lastReload = mount.reload; float lastReload = mount.reload;
mount.reload = Math.max(mount.reload - Time.delta * unit.reloadMultiplier, 0); mount.reload = Math.max(mount.reload - Time.delta * unit.reloadMultiplier, 0);
mount.recoil = Mathf.approachDelta(mount.recoil, 0, (recoil * unit.reloadMultiplier) / recoilTime); mount.recoil = Mathf.approachDelta(mount.recoil, 0, (Math.abs(recoil) * unit.reloadMultiplier) / recoilTime);
//rotate if applicable //rotate if applicable
if(rotate && (mount.rotate || mount.shoot) && can){ if(rotate && (mount.rotate || mount.shoot) && can){