summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-10 18:30:02 +0000
committerrubidium <rubidium@openttd.org>2009-07-10 18:30:02 +0000
commit3b8d0621a2621531e9be38cf3247e015558f1971 (patch)
treefc75fa25c77168ae6d138cadd380b5d8802c800a /src/order_gui.cpp
parentc654dedb28b9f3f15eda261545daa333534a7177 (diff)
downloadopenttd-3b8d0621a2621531e9be38cf3247e015558f1971.tar.xz
(svn r16785) -Codechange: make ships going to buoys use OT_GOTO_WAYPOINT too
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp28
1 files changed, 24 insertions, 4 deletions
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;