Add ActorsHavingTrait<TTrait>([Func<TTrait, bool])

This commit is contained in:
atlimit8
2015-10-25 04:45:53 -05:00
parent 0997f5b52f
commit b6f17df260
27 changed files with 132 additions and 125 deletions

View File

@@ -42,9 +42,8 @@ namespace OpenRA.Mods.Common.Activities
if (dest == null)
{
var rearmBuildings = heli.Info.RearmBuildings;
var nearestHpad = self.World.ActorsWithTrait<Reservable>()
.Where(a => a.Actor.Owner == self.Owner && rearmBuildings.Contains(a.Actor.Info.Name))
.Select(a => a.Actor)
var nearestHpad = self.World.ActorsHavingTrait<Reservable>()
.Where(a => a.Owner == self.Owner && rearmBuildings.Contains(a.Info.Name))
.ClosestTo(self);
if (nearestHpad == null)