Set actor race (and icons) based on active producer.

This commit is contained in:
Paul Chote
2015-02-11 23:37:56 +00:00
parent 44159ecdd6
commit d1ed1bf0fb
7 changed files with 55 additions and 43 deletions

View File

@@ -252,7 +252,8 @@ namespace OpenRA.Mods.Common.Widgets
public void RefreshIcons()
{
icons = new Dictionary<Rectangle, ProductionIcon>();
if (CurrentQueue == null)
var producer = CurrentQueue != null ? CurrentQueue.MostLikelyProducer() : default(TraitPair<Production>);
if (CurrentQueue == null || producer.Trait == null)
{
if (DisplayedIconCount != 0)
{
@@ -268,7 +269,7 @@ namespace OpenRA.Mods.Common.Widgets
var ks = Game.Settings.Keys;
var rb = RenderBounds;
var race = CurrentQueue.Actor.Owner.Country.Race;
var race = producer.Trait.Race;
foreach (var item in AllBuildables.Skip(IconRowOffset * Columns).Take(MaxIconRowOffset * Columns))
{