Don’t crash on bogus TerrainTiles.
This commit is contained in:
@@ -282,7 +282,10 @@ namespace OpenRA
|
|||||||
|
|
||||||
public TerrainTileInfo GetTileInfo(TerrainTile r)
|
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;
|
return tpl.Contains(r.Index) ? tpl[r.Index] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user