From ab2f260a528ba09e088ccda7f5ea7e3219b4c25a Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 14 Jul 2018 17:16:13 -0400 Subject: [PATCH] Fixed some crashes --- build.gradle | 2 +- core/src/io/anuke/mindustry/input/MobileInput.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index ec66d5463b..87c55f22f3 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ allprojects { gdxVersion = '1.9.8' roboVMVersion = '2.3.0' aiVersion = '1.8.1' - uCoreVersion = 'c502931313' + uCoreVersion = '3e5d498bd7' getVersionString = { String buildVersion = getBuildVersion() diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 4fc313a31c..1d46e50abf 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -412,11 +412,13 @@ public class MobileInput extends InputHandler implements GestureListener{ } } + TargetTrait target = player.target; + //draw targeting crosshair - if(player.target != null){ - if(player.target != lastTarget){ + if(target != null){ + if(target != lastTarget){ crosshairScale = 0f; - lastTarget = player.target; + lastTarget = target; } crosshairScale = Mathf.lerpDelta(crosshairScale, 1f, 0.2f); @@ -426,8 +428,8 @@ public class MobileInput extends InputHandler implements GestureListener{ float radius = Interpolation.swingIn.apply(crosshairScale); - Lines.poly(player.target.getX(), player.target.getY(), 4, 7f * radius, Timers.time() * 1.5f); - Lines.spikes(player.target.getX(), player.target.getY(), 3f * radius, 6f * radius, 4, Timers.time() * 1.5f); + Lines.poly(target.getX(), target.getY(), 4, 7f * radius, Timers.time() * 1.5f); + Lines.spikes(target.getX(), target.getY(), 3f * radius, 6f * radius, 4, Timers.time() * 1.5f); } Draw.reset();