summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-09-24 16:51:36 +0000
committersmatz <smatz@openttd.org>2008-09-24 16:51:36 +0000
commit4057132b00ee226aec5ba937b2ef6a5a531c8c73 (patch)
tree6c3667d5b9c898464b768b16ba520e18a30fef56
parenta000de84187c2b2eff9fae2cf89163bf073a498d (diff)
downloadopenttd-4057132b00ee226aec5ba937b2ef6a5a531c8c73.tar.xz
(svn r14396) -Fix: ctrl+right click at 'Go to nearest depot' order scrolled to depot with DepotID == 0
-rw-r--r--src/order_gui.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index fe7fcdea0..7a2586676 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -805,13 +805,17 @@ public:
if (_ctrl_pressed && sel < this->vehicle->num_orders) {
const Order *ord = GetVehicleOrder(this->vehicle, sel);
- TileIndex xy;
+ TileIndex xy = 0;
switch (ord->GetType()) {
case OT_GOTO_STATION: xy = GetStation(ord->GetDestination())->xy ; break;
- case OT_GOTO_DEPOT: xy = (this->vehicle->type == VEH_AIRCRAFT) ? GetStation(ord->GetDestination())->xy : GetDepot(ord->GetDestination())->xy; break;
case OT_GOTO_WAYPOINT: xy = GetWaypoint(ord->GetDestination())->xy; break;
- default: xy = 0; break;
+ case OT_GOTO_DEPOT:
+ if ((ord->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) break;
+ xy = (this->vehicle->type == VEH_AIRCRAFT) ? GetStation(ord->GetDestination())->xy : GetDepot(ord->GetDestination())->xy;
+ break;
+ default:
+ break;
}
if (xy != 0) ScrollMainWindowToTile(xy);