support ProductionBar properly in cnc too

This commit is contained in:
Chris Forbes
2011-03-02 23:22:57 +13:00
parent 0bfcb4585c
commit 43dccb073d
2 changed files with 9 additions and 2 deletions

View File

@@ -26,12 +26,12 @@ namespace OpenRA.Mods.RA
public float GetValue()
{
var queue = self.TraitOrDefault<ProductionQueue>();
var queue = self.TraitsImplementing<ProductionQueue>().FirstOrDefault(q => q.CurrentItem() != null);
if (queue == null)
{
var produces = self.Trait<Production>().Info.Produces;
queue = self.Owner.PlayerActor.TraitsImplementing<ProductionQueue>()
.First(q => produces.Contains(q.Info.Type));
.FirstOrDefault(q => produces.Contains(q.Info.Type));
}
if (queue == null || queue.CurrentItem() == null)