From 5d0eecd4c5b6a0489f2f6a77fba9d597ef9d6d56 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 8 Mar 2015 10:52:16 +0000 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20crash=20on=20bogus=20TerrainTil?= =?UTF-8?q?es.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenRA.Game/Map/TileSet.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Map/TileSet.cs b/OpenRA.Game/Map/TileSet.cs index 05ab4bb63c..fc3733597c 100644 --- a/OpenRA.Game/Map/TileSet.cs +++ b/OpenRA.Game/Map/TileSet.cs @@ -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; }