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:
SamuXarick
2025-01-30 13:28:12 +00:00
committed by rubidium42
parent 3ea4d1d4fc
commit f5d43ffdf8
4 changed files with 6 additions and 4 deletions

View File

@@ -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);
}