Ticket #1884: attack_plan_error.diff
File attack_plan_error.diff, 811 bytes (added by , 11 years ago) |
---|
-
binaries/data/mods/public/simulation/ai/qbot-wc/attack_plan.js
344 344 if (targets.length) { 345 345 debug ("Aiming for " + targets); 346 346 // picking a target 347 var maxDist = 1000000;347 var maxDist = -1; 348 348 var index = 0; 349 349 for (i in targets._entities) 350 350 { 351 351 // we're sure it has a position has TargetFinder already checks that. 352 352 var dist = SquareVectorDistance(targets._entities[i].position(), this.rallyPoint); 353 if (dist < maxDist )353 if (dist < maxDist || maxDist === -1) 354 354 { 355 355 maxDist = dist; 356 356 index = i;