Make the legacy editor more robust against invalid templates.

This commit is contained in:
Paul Chote
2014-10-23 10:26:36 +13:00
parent 2b0042ca23
commit fda25a56ca
3 changed files with 12 additions and 2 deletions

View File

@@ -275,6 +275,9 @@ namespace OpenRA.Editor
var vj = v * ChunkSize + j;
var tr = Map.MapTiles.Value[ui, vj];
var tile = TileSetRenderer.Data(tr.Type);
if (tile == null)
continue;
var index = (tr.Index < tile.Length) ? tr.Index : (byte)0;
var rawImage = tile[index];
for (var x = 0; x < TileSetRenderer.TileSize; x++)