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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user