remove pointless null checks for owner
This commit is contained in:
@@ -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 );
|
||||||
|
|
||||||
|
|||||||
@@ -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 );
|
||||||
|
|||||||
Reference in New Issue
Block a user