From cf4f912cef8ebba68efa9ca962d31df09e508ea1 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 11 Nov 2020 14:55:16 -0500 Subject: [PATCH] Cleanup --- core/src/mindustry/entities/comp/UnitComp.java | 3 ++- core/src/mindustry/input/DesktopInput.java | 4 +--- core/src/mindustry/input/MobileInput.java | 3 +-- gradle.properties | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 4c199542c3..12c00b10d2 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -69,8 +69,9 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I } public float speed(){ + float strafePenalty = isGrounded() || !isPlayer() ? 1f : Mathf.lerp(1f, type.strafePenalty, Angles.angleDist(vel().angle(), rotation) / 180f); //limit speed to minimum formation speed to preserve formation - return isCommanding() ? minFormationSpeed * 0.98f : type.speed; + return (isCommanding() ? minFormationSpeed * 0.98f : type.speed) * strafePenalty; } /** @return speed with boost multipliers factored in. */ diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index e77d092af1..c11728be47 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -602,9 +602,7 @@ public class DesktopInput extends InputHandler{ boolean omni = unit.type.omniMovement; boolean ground = unit.isGrounded(); - float strafePenalty = ground ? 1f : Mathf.lerp(1f, unit.type.strafePenalty, Angles.angleDist(unit.vel().angle(), unit.rotation()) / 180f); - - float speed = unit.realSpeed() * strafePenalty; + float speed = unit.realSpeed(); float xa = Core.input.axis(Binding.move_x); float ya = Core.input.axis(Binding.move_y); boolean boosted = (unit instanceof Mechc && unit.isFlying()); diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 11e7aa12f4..0f64ce0cf7 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -854,9 +854,8 @@ public class MobileInput extends InputHandler implements GestureListener{ targetPos.set(Core.camera.position); float attractDst = 15f; - float strafePenalty = legs ? 1f : Mathf.lerp(1f, type.strafePenalty, Angles.angleDist(unit.vel.angle(), unit.rotation) / 180f); - float speed = unit.realSpeed() * strafePenalty; + float speed = unit.realSpeed(); float range = unit.hasWeapons() ? unit.range() : 0f; float bulletSpeed = unit.hasWeapons() ? type.weapons.first().bullet.speed : 0f; float mouseAngle = unit.angleTo(unit.aimX(), unit.aimY()); diff --git a/gradle.properties b/gradle.properties index 6b41e5aa7a..ee126bcf75 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=2c022c5c2723b39e63da7cadd6c53ce6ec78f9d3 +archash=a6f488d6f741b98d123113ceb26439032be0719e