diff --git a/OpenRA.Game/Traits/World/ResourceLayer.cs b/OpenRA.Game/Traits/World/ResourceLayer.cs index 0e9429d81e..3e38780a15 100644 --- a/OpenRA.Game/Traits/World/ResourceLayer.cs +++ b/OpenRA.Game/Traits/World/ResourceLayer.cs @@ -37,6 +37,9 @@ namespace OpenRA.Traits var miny = cliprect.Top; var maxy = cliprect.Bottom; + foreach( var rt in world.WorldActor.TraitsImplementing() ) + rt.info.PaletteIndex = world.WorldRenderer.GetPaletteIndex(rt.info.Palette); + for (int x = minx; x < maxx; x++) for (int y = miny; y < maxy; y++) { @@ -48,7 +51,7 @@ namespace OpenRA.Traits if (c.image != null) c.image[c.density].DrawAt( Game.CellSize * new int2(x, y), - c.type.info.Palette); + c.type.info.PaletteIndex); } } diff --git a/OpenRA.Game/Traits/World/ResourceType.cs b/OpenRA.Game/Traits/World/ResourceType.cs index f554fda5e9..8b9680bd74 100644 --- a/OpenRA.Game/Traits/World/ResourceType.cs +++ b/OpenRA.Game/Traits/World/ResourceType.cs @@ -23,6 +23,7 @@ namespace OpenRA.Traits public readonly string TerrainType = "Ore"; public Sprite[][] Sprites; + public int PaletteIndex; public object Create(ActorInitializer init) { return new ResourceType(this); } }