Don’t crash on bogus TerrainTiles.

This commit is contained in:
Paul Chote
2015-03-08 10:52:16 +00:00
parent c5625d0d70
commit 5d0eecd4c5

View File

@@ -282,7 +282,10 @@ namespace OpenRA
public TerrainTileInfo GetTileInfo(TerrainTile r)
{
var tpl = Templates[r.Type];
TerrainTemplateInfo tpl;
if (!Templates.TryGetValue(r.Type, out tpl))
return null;
return tpl.Contains(r.Index) ? tpl[r.Index] : null;
}