Merge pull request #7650 from Phrohdoh/fix-ramp-nre

Fix NRE caused by checking the RampType of a tile in #7645.
This commit is contained in:
Pavel Penev
2015-03-13 20:30:02 +02:00

View File

@@ -28,9 +28,10 @@ namespace OpenRA.Mods.Common.Traits
return false; return false;
var tile = world.Map.MapTiles.Value[cell]; 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 false;
return bi.TerrainTypes.Contains(world.Map.GetTerrainInfo(cell).Type); return bi.TerrainTypes.Contains(world.Map.GetTerrainInfo(cell).Type);