Change Squad.IsEmpty -> IsValid.

This commit is contained in:
Paul Chote
2013-08-24 10:29:00 +12:00
parent fd311502f5
commit 233ba81976
6 changed files with 28 additions and 18 deletions

View File

@@ -483,7 +483,7 @@ namespace OpenRA.Mods.RA.AI
void CleanSquads()
{
squads.RemoveAll(s => s.IsEmpty);
squads.RemoveAll(s => !s.IsValid);
foreach (var s in squads)
s.units.RemoveAll(a => a.Destroyed || a.IsDead());
}
@@ -647,7 +647,7 @@ namespace OpenRA.Mods.RA.AI
if (!protectSq.TargetIsValid)
protectSq.Target = attacker;
if (protectSq.IsEmpty)
if (!protectSq.IsValid)
{
var ownUnits = world.FindActorsInCircle(baseCenter.CenterPosition, WRange.FromCells(15))
.Where(unit => unit.Owner == p && !unit.HasTrait<Building>()