mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-10 06:52:05 +01:00
Add: [Script] ScriptTile::IsHouseTile
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
* \li AIVehicleList_Waypoint
|
||||
* \li AIError::ERR_BRIDGE_TOO_LOW
|
||||
* \li AIEngine::GetAllRailTypes
|
||||
* \li AITile::IsHouseTile
|
||||
*
|
||||
* Other changes:
|
||||
* \li AIBridge::GetBridgeID renamed to AIBridge::GetBridgeType
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
* \li GSBaseStation::GetOwner
|
||||
* \li GSError::ERR_BRIDGE_TOO_LOW
|
||||
* \li GSEngine::GetAllRailTypes
|
||||
* \li GSTile::IsHouseTile
|
||||
*
|
||||
* Other changes:
|
||||
* \li GSBridge::GetBridgeID renamed to GSBridge::GetBridgeType
|
||||
|
||||
@@ -154,6 +154,13 @@
|
||||
return (::IsTileType(tile, MP_CLEAR) && ::IsClearGround(tile, CLEAR_DESERT));
|
||||
}
|
||||
|
||||
/* static */ bool ScriptTile::IsHouseTile(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return false;
|
||||
|
||||
return ::IsTileType(tile, MP_HOUSE);
|
||||
}
|
||||
|
||||
/* static */ ScriptTile::TerrainType ScriptTile::GetTerrainType(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return TERRAIN_NORMAL;
|
||||
|
||||
@@ -275,6 +275,14 @@ public:
|
||||
*/
|
||||
static bool IsDesertTile(TileIndex tile);
|
||||
|
||||
/**
|
||||
* Check if the tile is town house/building
|
||||
* @param tile The tile to check on.
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @return True if and only if the tile is house tile.
|
||||
*/
|
||||
static bool IsHouseTile(TileIndex tile);
|
||||
|
||||
/**
|
||||
* Get the type of terrain regardless of buildings or infrastructure.
|
||||
* @note When a desert or rainforest tile are changed, their terrain type will remain the same. In other words, a sea tile can be of the desert terrain type.
|
||||
|
||||
Reference in New Issue
Block a user