Fix negative recoil (#6107)
This commit is contained in:
@@ -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 = Math.max(mount.recoil - (Time.delta * recoil * unit.reloadMultiplier) / recoilTime, 0);
|
mount.recoil = Mathf.approachDelta(mount.recoil, 0, (recoil * unit.reloadMultiplier) / recoilTime);
|
||||||
|
|
||||||
//rotate if applicable
|
//rotate if applicable
|
||||||
if(rotate && (mount.rotate || mount.shoot) && can){
|
if(rotate && (mount.rotate || mount.shoot) && can){
|
||||||
|
|||||||
Reference in New Issue
Block a user