This commit is contained in:
Chris Forbes
2011-04-17 13:34:43 +12:00
committed by Paul Chote
parent e4dcf256aa
commit 5e0f57d730

View File

@@ -309,20 +309,20 @@ namespace OpenRA.Mods.RA
}
// If we have any attackers, let them scan for enemy units and stop and regroup if they spot any
if (attackForce.Count > 0 )
if (attackForce.Count > 0)
{
bool foundEnemy = false;
foreach (var a1 in attackForce)
{
var enemyUnits = world.FindUnitsInCircle(a1.CenterLocation, Game.CellSize * 10)
.Where(unit => IsHumanPlayer(unit.Owner) ).ToList();
.Where(unit => IsHumanPlayer(unit.Owner)).ToList();
if (enemyUnits.Count > 0)
{
//BotDebug("Found enemy "+enemyUnits.First().Info.Name);
// Found enemy units nearby.
foundEnemy = true;
var enemy = enemyUnits.OrderBy( e => (e.Location - a1.Location).LengthSquared ).First();
var enemy = enemyUnits.OrderBy(e => (e.Location - a1.Location).LengthSquared).First();
// Check how many own units we have gathered nearby...
var ownUnits = world.FindUnitsInCircle(a1.CenterLocation, Game.CellSize * 2)