From d820e7d31a9e5bc51d9e6dca71e410818748e7f2 Mon Sep 17 00:00:00 2001 From: MEEP of Faith <54301439+MEEPofFaith@users.noreply.github.com> Date: Mon, 3 May 2021 19:10:36 -0700 Subject: [PATCH] Fix small linecast issue (#5192) --- core/src/mindustry/entities/Damage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 399f9e664a..1e66934577 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -266,8 +266,8 @@ public class Damage{ }); if(tmpBuilding != null && tmpUnit != null){ - if(Mathf.dst2(x, y, tmpUnit.getX(), tmpUnit.getY()) <= Mathf.dst2(x, y, tmpBuilding.getX(), tmpBuilding.getY())){ - return tmpUnit; + if(Mathf.dst2(x, y, tmpBuilding.getX(), tmpBuilding.getY()) <= Mathf.dst2(x, y, tmpUnit.getX(), tmpUnit.getY())){ + return tmpBuilding; } }else if(tmpBuilding != null){ return tmpBuilding;