tabify
This commit is contained in:
@@ -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 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;
|
bool foundEnemy = false;
|
||||||
foreach (var a1 in attackForce)
|
foreach (var a1 in attackForce)
|
||||||
{
|
{
|
||||||
var enemyUnits = world.FindUnitsInCircle(a1.CenterLocation, Game.CellSize * 10)
|
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)
|
if (enemyUnits.Count > 0)
|
||||||
{
|
{
|
||||||
//BotDebug("Found enemy "+enemyUnits.First().Info.Name);
|
//BotDebug("Found enemy "+enemyUnits.First().Info.Name);
|
||||||
// Found enemy units nearby.
|
// Found enemy units nearby.
|
||||||
foundEnemy = true;
|
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...
|
// Check how many own units we have gathered nearby...
|
||||||
var ownUnits = world.FindUnitsInCircle(a1.CenterLocation, Game.CellSize * 2)
|
var ownUnits = world.FindUnitsInCircle(a1.CenterLocation, Game.CellSize * 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user