summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index c84bd522c..048af0e4c 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -2432,7 +2432,15 @@ public:
SetDParam(0, v->type);
SetDParam(1, v->current_order.GetDestination());
SetDParam(2, v->GetDisplaySpeed());
- if (v->current_order.GetDepotActionType() & ODATFB_HALT) {
+ if (v->current_order.GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
+ /* This case *only* happens when multiple nearest depot orders
+ * follow eachother (including an order list only one order: a
+ * nearest depot order) and there are no reachable depots.
+ * It is primarily to guard for the case that there is no
+ * depot with index 0, which would be used as fallback for
+ * evaluating the string in the status bar. */
+ str = STR_EMPTY;
+ } else if (v->current_order.GetDepotActionType() & ODATFB_HALT) {
str = STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_VEL;
} else {
str = STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE_VEL;