Changeset - r17284:259dd48e2856
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2011-02-08 22:36:16
rubidium@openttd.org
(svn r22034) -Fix [FS#4488]: crash when watching the vehicle view of a vehicle that has multiple sequential nearest depot orders (or consists of a single nearest depot order) when there is no depot with index 0
1 file changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/vehicle_gui.cpp
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)