split PrimaryBuilding from Production

This commit is contained in:
Chris Forbes
2010-08-09 17:20:34 +12:00
parent cb5307bb17
commit 8f6fe8344b
7 changed files with 97 additions and 60 deletions

View File

@@ -170,7 +170,7 @@ namespace OpenRA.Traits
var producers = self.World.Queries.OwnedBy[self.Owner]
.WithTrait<Production>()
.Where(x => producerTypes.Contains(x.Actor.Info))
.OrderByDescending(x => x.Trait.IsPrimary ? 1 : 0) // prioritize the primary.
.OrderByDescending(x => x.Actor.IsPrimaryBuilding() ? 1 : 0 ) // prioritize the primary.
.ToArray();
if (producers.Length == 0)