From be46f44bc9e85e69a484217efe8f6bbdd7c46e6b Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 7 Sep 2010 19:09:18 +1200 Subject: [PATCH] polish multiple rows of pips (RA proc) --- OpenRA.Game/Traits/Selectable.cs | 6 +++++- OpenRA.Mods.RA/OreRefinery.cs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Traits/Selectable.cs b/OpenRA.Game/Traits/Selectable.cs index c203bb09b1..0b4769a3f6 100644 --- a/OpenRA.Game/Traits/Selectable.cs +++ b/OpenRA.Game/Traits/Selectable.cs @@ -109,7 +109,11 @@ namespace OpenRA.Traits foreach (var pips in self.TraitsImplementing()) { - foreach (var pip in pips.GetPips(self)) + var thisRow = pips.GetPips(self); + if (thisRow == null) + continue; + + foreach (var pip in thisRow) { if (pipxyOffset.X+5 > self.GetBounds(false).Width) { diff --git a/OpenRA.Mods.RA/OreRefinery.cs b/OpenRA.Mods.RA/OreRefinery.cs index a7f2551cc9..775ce7fdf6 100644 --- a/OpenRA.Mods.RA/OreRefinery.cs +++ b/OpenRA.Mods.RA/OreRefinery.cs @@ -125,7 +125,7 @@ namespace OpenRA.Mods.RA public IEnumerable GetPips (Actor self) { if (!Info.LocalStorage) - return new PipType[] { }; + return null; return Graphics.Util.MakeArray (Info.PipCount, i => (Ore * 1f / Info.Capacity > i * 1f / Info.PipCount) ? Info.PipColor : PipType.Transparent); }