From 50dff05675a4622c036c4a9d51a94dabd60cd984 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 2 Jun 2013 19:26:55 +1200 Subject: [PATCH] Return a synthesized tile for missing indices. Fixes #3329. --- OpenRA.FileFormats/Map/TileSet.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.FileFormats/Map/TileSet.cs b/OpenRA.FileFormats/Map/TileSet.cs index 621a47bd26..a59ad79e0f 100644 --- a/OpenRA.FileFormats/Map/TileSet.cs +++ b/OpenRA.FileFormats/Map/TileSet.cs @@ -148,7 +148,11 @@ namespace OpenRA.FileFormats { TileTemplate tile; if (Templates.TryGetValue(r.type, out tile)) - return tile.Data.TileBitmapBytes[r.index]; + { + var data = tile.Data.TileBitmapBytes[r.index]; + if (data != null) + return data; + } byte[] missingTile = new byte[TileSize*TileSize]; for (var i = 0; i < missingTile.Length; i++)