(svn r25213) -Fix [FS#5537]: clarify on which tiles IsDesertTile and IsSnowTile work, i.e. the ones without infrastructure or buildings
-Feature: introduce GetTerrainType which allows one to get that information for tiles with buildings and infrastructure as well
This commit is contained in:
@@ -135,6 +135,19 @@
|
||||
return (::IsTileType(tile, MP_CLEAR) && ::IsClearGround(tile, CLEAR_DESERT));
|
||||
}
|
||||
|
||||
/* static */ ScriptTile::TerrainType ScriptTile::GetTerrainType(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return TERRAIN_NORMAL;
|
||||
|
||||
switch (::GetTerrainType(tile)) {
|
||||
default:
|
||||
case 0: return TERRAIN_NORMAL;
|
||||
case 1: return TERRAIN_DESERT;
|
||||
case 2: return TERRAIN_RAINFOREST;
|
||||
case 4: return TERRAIN_SNOW;
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ ScriptTile::Slope ScriptTile::GetSlope(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return SLOPE_INVALID;
|
||||
|
Reference in New Issue
Block a user