From 3b8d0621a2621531e9be38cf3247e015558f1971 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 10 Jul 2009 18:30:02 +0000 Subject: (svn r16785) -Codechange: make ships going to buoys use OT_GOTO_WAYPOINT too --- src/order_gui.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'src/order_gui.cpp') diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 33e11099c..8a9d01340 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -253,8 +253,15 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int break; case OT_GOTO_WAYPOINT: - SetDParam(1, (order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT); - SetDParam(2, order->GetDestination()); + if (v->type == VEH_TRAIN) { + SetDParam(1, (order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT); + SetDParam(2, order->GetDestination()); + } else { + SetDParam(1, STR_GO_TO_STATION); + SetDParam(2, STR_ORDER_GO_VIA); + SetDParam(3, order->GetDestination()); + SetDParam(4, STR_EMPTY); + } break; case OT_CONDITIONAL: @@ -350,6 +357,11 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) return order; } + if (IsBuoyTile(tile) && v->type == VEH_SHIP) { + order.MakeGoToWaypoint(GetStationIndex(tile)); + return order; + } + if (IsTileType(tile, MP_STATION)) { StationID st_index = GetStationIndex(tile); const Station *st = Station::Get(st_index); @@ -857,8 +869,16 @@ public: TileIndex xy = INVALID_TILE; switch (ord->GetType()) { - case OT_GOTO_STATION: xy = Station::Get(ord->GetDestination())->xy ; break; - case OT_GOTO_WAYPOINT: xy = Waypoint::Get(ord->GetDestination())->xy; break; + case OT_GOTO_WAYPOINT: + if (this->vehicle->type == VEH_TRAIN) { + xy = Waypoint::Get(ord->GetDestination())->xy; + break; + } + /* FALL THROUGH */ + case OT_GOTO_STATION: + xy = Station::Get(ord->GetDestination())->xy; + break; + case OT_GOTO_DEPOT: if ((ord->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) break; xy = (this->vehicle->type == VEH_AIRCRAFT) ? Station::Get(ord->GetDestination())->xy : Depot::Get(ord->GetDestination())->xy; -- cgit v1.2.3-54-g00ecf