diff --git a/OpenRA.Game/Map/TileSet.cs b/OpenRA.Game/Map/TileSet.cs index 1c26b33c27..613864956a 100644 --- a/OpenRA.Game/Map/TileSet.cs +++ b/OpenRA.Game/Map/TileSet.cs @@ -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)) {