Fix small linecast issue (#5192)

This commit is contained in:
MEEP of Faith 2021-05-03 19:10:36 -07:00 committed by GitHub
parent 0193d586d1
commit d820e7d31a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;