Fix NRE caused by checking the RampType of a tile in #7645.

This commit is contained in:
Taryn Hill
2015-03-11 19:28:50 -05:00
parent 687403ab89
commit 602de0ea13

View File

@@ -28,9 +28,10 @@ namespace OpenRA.Mods.Common.Traits
return false;
var tile = world.Map.MapTiles.Value[cell];
var rampType = world.TileSet.GetTileInfo(tile).RampType;
var tileInfo = world.TileSet.GetTileInfo(tile);
if (rampType > 0)
// TODO: This is bandaiding over bogus tilesets.
if (tileInfo != null && tileInfo.RampType > 0)
return false;
return bi.TerrainTypes.Contains(world.Map.GetTerrainInfo(cell).Type);