mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-18 19:19:29 +01:00
Fix: [Script] Make ScriptOrder functions aware of road waypoints (#13419)
This commit is contained in:
parent
484f18f987
commit
ac8b236885
@ -35,7 +35,7 @@ static OrderType GetOrderTypeByTile(TileIndex t)
|
||||
switch (::GetTileType(t)) {
|
||||
default: break;
|
||||
case MP_STATION:
|
||||
if (IsBuoy(t) || IsRailWaypoint(t)) return OT_GOTO_WAYPOINT;
|
||||
if (IsBuoy(t) || IsRailWaypoint(t) || IsRoadWaypoint(t)) return OT_GOTO_WAYPOINT;
|
||||
if (IsHangar(t)) return OT_GOTO_DEPOT;
|
||||
return OT_GOTO_STATION;
|
||||
|
||||
@ -286,8 +286,12 @@ static ScriptOrder::OrderPosition RealOrderPositionToScriptOrderPosition(Vehicle
|
||||
for (TileIndex t : wp->train_station) {
|
||||
if (wp->TileBelongsToRailStation(t)) return t;
|
||||
}
|
||||
} else if (wp->road_waypoint_area.tile != INVALID_TILE) {
|
||||
for (TileIndex t : wp->road_waypoint_area) {
|
||||
if (::IsRoadWaypointTile(t) && ::GetStationIndex(t) == wp->index) return t;
|
||||
}
|
||||
}
|
||||
/* If the waypoint has no rail waypoint tiles, it must have a buoy */
|
||||
/* If the waypoint has no rail or road waypoint tiles, it must have a buoy */
|
||||
return wp->xy;
|
||||
}
|
||||
default: return INVALID_TILE;
|
||||
|
Loading…
Reference in New Issue
Block a user