Allow ProductionQueue to filter by race.

This commit is contained in:
Paul Chote
2014-06-21 19:33:39 +12:00
parent d9e0559c7a
commit ca082e3cec
8 changed files with 39 additions and 15 deletions

View File

@@ -36,12 +36,12 @@ namespace OpenRA.Mods.RA
return;
// Queue-per-structure
var perqueue = world.Selection.Actors.FirstOrDefault(
a => a.IsInWorld && a.World.LocalPlayer == a.Owner && a.HasTrait<ProductionQueue>());
var perqueue = world.Selection.Actors.FirstOrDefault(a => a.IsInWorld && a.World.LocalPlayer == a.Owner
&& a.TraitsImplementing<ProductionQueue>().Any(q => q.Enabled));
if (perqueue != null)
{
palette.SetCurrentTab(perqueue.TraitsImplementing<ProductionQueue>().First());
palette.SetCurrentTab(perqueue.TraitsImplementing<ProductionQueue>().First(q => q.Enabled));
return;
}
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA
return;
palette.SetCurrentTab(world.LocalPlayer.PlayerActor.TraitsImplementing<ProductionQueue>()
.FirstOrDefault(t => types.Contains(t.Info.Type)));
.FirstOrDefault(q => q.Enabled && types.Contains(q.Info.Type)));
}
}
}