summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index d591bb438..9f974f8b8 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -996,23 +996,7 @@ public:
int sel = this->GetOrderFromPt(pt.y);
if (_ctrl_pressed && sel < this->vehicle->GetNumOrders()) {
- const Order *ord = this->vehicle->GetOrder(sel);
- TileIndex xy = INVALID_TILE;
-
- switch (ord->GetType()) {
- case OT_GOTO_WAYPOINT:
- case OT_GOTO_STATION:
- xy = BaseStation::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;
- break;
- default:
- break;
- }
-
+ TileIndex xy = this->vehicle->GetOrder(sel)->GetLocation(this->vehicle);
if (xy != INVALID_TILE) ScrollMainWindowToTile(xy);
return;
}