mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 07:29:44 +00:00
Change: [Script] GetWaypointID to return the StationID of any waypoint
Modified ScriptWaypoint::GetWaypointID to also return the StationID of any waypoint (including road waypoint).
This commit is contained in:
parent
3ea4d1d4fc
commit
f5d43ffdf8
@ -24,6 +24,7 @@
|
||||
*
|
||||
* Other changes:
|
||||
* \li AIBridge::GetBridgeID renamed to AIBridge::GetBridgeType
|
||||
* \li AIWaypoint::GetWaypointID now returns the StationID of any type of waypoint
|
||||
*
|
||||
* \b 14.0
|
||||
*
|
||||
|
@ -24,6 +24,7 @@
|
||||
*
|
||||
* Other changes:
|
||||
* \li GSBridge::GetBridgeID renamed to GSBridge::GetBridgeType
|
||||
* \li GSWaypoint::GetWaypointID now returns the StationID of any type of waypoint
|
||||
*
|
||||
* \b 14.0
|
||||
*
|
||||
|
@ -24,8 +24,7 @@
|
||||
|
||||
/* static */ StationID ScriptWaypoint::GetWaypointID(TileIndex tile)
|
||||
{
|
||||
if (!ScriptRail::IsRailWaypointTile(tile) && !ScriptMarine::IsBuoyTile(tile)) return STATION_INVALID;
|
||||
|
||||
if (!::IsValidTile(tile) || !::IsTileType(tile, MP_STATION) || ::Waypoint::GetByTile(tile) == nullptr) return INVALID_STATION;
|
||||
return ::GetStationIndex(tile);
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,11 @@ public:
|
||||
static bool IsValidWaypoint(StationID waypoint_id);
|
||||
|
||||
/**
|
||||
* Get the StationID of a tile.
|
||||
* Get the StationID of a tile, if there is a waypoint.
|
||||
* @param tile The tile to find the StationID of.
|
||||
* @pre ScriptRail::IsRailWaypointTile(tile).
|
||||
* @pre IsValidTile(tile).
|
||||
* @return StationID of the waypoint.
|
||||
* @post Use IsValidWaypoint() to see if the waypoint is valid.
|
||||
*/
|
||||
static StationID GetWaypointID(TileIndex tile);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user