Damage distance check fix
This commit is contained in:
@@ -270,13 +270,13 @@ public class Damage{
|
|||||||
Units.nearbyEnemies(hitter.team, rect, cons);
|
Units.nearbyEnemies(hitter.team, rect, cons);
|
||||||
|
|
||||||
if(tmpBuilding != null && tmpUnit != null){
|
if(tmpBuilding != null && tmpUnit != null){
|
||||||
float bDst = Mathf.dst2(x, y, tmpBuilding.getX(), tmpBuilding.getY());
|
if(Mathf.dst2(x, y, tmpUnit.getX(), tmpUnit.getY()) <= Mathf.dst2(x, y, tmpBuilding.getX(), tmpBuilding.getY())){
|
||||||
float uDst = Mathf.dst2(x, y, tmpUnit.getX(), tmpUnit.getY());
|
return tmpUnit;
|
||||||
if(uDst <= bDst) return tmpUnit;
|
}
|
||||||
if(bDst > uDst) return tmpBuilding;
|
}else if(tmpBuilding != null){
|
||||||
}else if(tmpBuilding != null && tmpUnit == null){
|
|
||||||
return tmpBuilding;
|
return tmpBuilding;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmpUnit;
|
return tmpUnit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ public class ModsDialog extends BaseDialog{
|
|||||||
title.table(text -> {
|
title.table(text -> {
|
||||||
boolean hideDisabled = !mod.isSupported() || mod.hasUnmetDependencies() || mod.hasContentErrors();
|
boolean hideDisabled = !mod.isSupported() || mod.hasUnmetDependencies() || mod.hasContentErrors();
|
||||||
|
|
||||||
text.add("" + Strings.stripColors(mod.meta.displayName()) + "\n[lightgray]v" + Strings.stripColors(trimText(mod.meta.version)) + (mod.enabled() || hideDisabled ? "" : "\n" + Core.bundle.get("mod.disabled") + ""))
|
text.add("[accent]" + Strings.stripColors(mod.meta.displayName()) + "\n[lightgray]v" + Strings.stripColors(trimText(mod.meta.version)) + (mod.enabled() || hideDisabled ? "" : "\n" + Core.bundle.get("mod.disabled") + ""))
|
||||||
.wrap().top().width(300f).growX().left();
|
.wrap().top().width(300f).growX().left();
|
||||||
|
|
||||||
text.row();
|
text.row();
|
||||||
|
|||||||
Reference in New Issue
Block a user