remove pointless null checks for owner

This commit is contained in:
Chris Forbes
2011-08-21 19:34:45 +12:00
parent ee2be405ca
commit b95f49d6f3
2 changed files with 2 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.RA.Activities
{ {
// rearm & repair at fix, then back out here to refill the minefield some more // rearm & repair at fix, then back out here to refill the minefield some more
var buildings = self.Info.Traits.Get<MinelayerInfo>().RearmBuildings; var buildings = self.Info.Traits.Get<MinelayerInfo>().RearmBuildings;
var rearmTarget = self.World.Actors.Where(a => a.Owner != null && self.Owner.Stances[a.Owner] == Stance.Ally var rearmTarget = self.World.Actors.Where(a => self.Owner.Stances[a.Owner] == Stance.Ally
&& buildings.Contains(a.Info.Name)) && buildings.Contains(a.Info.Name))
.ClosestTo( self.CenterLocation ); .ClosestTo( self.CenterLocation );

View File

@@ -98,7 +98,7 @@ namespace OpenRA.Mods.RA
var inRange = self.World.FindUnitsInCircle(self.CenterLocation, (int)(Game.CellSize * range)); var inRange = self.World.FindUnitsInCircle(self.CenterLocation, (int)(Game.CellSize * range));
return inRange return inRange
.Where(a => a.Owner != null && a.AppearsHostileTo(self)) .Where(a => a.AppearsHostileTo(self))
.Where(a => !a.HasTrait<AutoTargetIgnore>()) .Where(a => !a.HasTrait<AutoTargetIgnore>())
.Where(a => attack.HasAnyValidWeapons(Target.FromActor(a))) .Where(a => attack.HasAnyValidWeapons(Target.FromActor(a)))
.ClosestTo( self.CenterLocation ); .ClosestTo( self.CenterLocation );