This commit is contained in:
Anuken
2020-10-02 09:54:08 -04:00
parent 215cfaa42f
commit 138434d029
14 changed files with 15 additions and 22 deletions

View File

@@ -215,12 +215,12 @@ public class Units{
cdist = 0f;
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> {
if(e.dead() || !predicate.get(e)) return;
if(e.dead() || !predicate.get(e) || !e.within(x, y, range)) return;
float dst2 = sort.cost(e, x, y);
if(dst2 < range*range && (result == null || dst2 < cdist)){
float cost = sort.cost(e, x, y);
if(result == null || cost < cdist){
result = e;
cdist = dst2;
cdist = cost;
}
});