don't crash so easily

This commit is contained in:
Matthias Mailänder
2015-03-22 18:18:19 +01:00
parent edbb31afe1
commit 2f1aae59eb

View File

@@ -246,7 +246,9 @@ namespace OpenRA
public byte GetTerrainIndex(TerrainTile r)
{
var tpl = Templates[r.Type];
TerrainTemplateInfo tpl;
if (!Templates.TryGetValue(r.Type, out tpl))
return defaultWalkableTerrainIndex;
if (tpl.Contains(r.Index))
{