From 62207313a06da5e193a76547a954ee55b6d95804 Mon Sep 17 00:00:00 2001 From: Andre Mohren Date: Fri, 11 Jun 2021 12:57:56 +0200 Subject: [PATCH] 32bpp assets dont need a palette to be defined. --- OpenRA.Game/Graphics/WorldRenderer.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index 7584bf8458..f9ef94adcf 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -85,7 +85,13 @@ namespace OpenRA.Graphics return new PaletteReference(name, palette.GetPaletteIndex(name), pal, palette); } - public PaletteReference Palette(string name) { return palettes.GetOrAdd(name, createPaletteReference); } + public PaletteReference Palette(string name) + { + // HACK: This is working around the fact that palettes are defined on traits rather than sequences + // and can be removed once this has been fixed. + return name == null ? null : palettes.GetOrAdd(name, createPaletteReference); + } + public void AddPalette(string name, ImmutablePalette pal, bool allowModifiers = false, bool allowOverwrite = false) { if (allowOverwrite && palette.Contains(name))