Implement equality on TraitPair.
This commit is contained in:
@@ -236,7 +236,7 @@ namespace OpenRA.Mods.Common.Orders
|
||||
|
||||
var blockers = allTiles.SelectMany(world.ActorMap.GetActorsAt)
|
||||
.Where(a => a.Owner == queue.Actor.Owner && a.IsIdle)
|
||||
.Select(a => new TraitPair<Mobile> { Actor = a, Trait = a.TraitOrDefault<Mobile>() });
|
||||
.Select(a => new TraitPair<Mobile>(a, a.TraitOrDefault<Mobile>()));
|
||||
|
||||
foreach (var blocker in blockers.Where(x => x.Trait != null))
|
||||
{
|
||||
|
||||
@@ -361,7 +361,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public virtual TraitPair<Production> MostLikelyProducer()
|
||||
{
|
||||
var trait = self.TraitsImplementing<Production>().FirstOrDefault(p => p.Info.Produces.Contains(Info.Type));
|
||||
return new TraitPair<Production> { Actor = self, Trait = trait };
|
||||
return new TraitPair<Production>(self, trait);
|
||||
}
|
||||
|
||||
// Builds a unit from the actor that holds this queue (1 queue per building)
|
||||
|
||||
Reference in New Issue
Block a user