src/train_cmd.cpp
changeset 6263 6bd0726c74e2
parent 6259 471b91a4b1d8
child 6303 584eb58fe283
equal deleted inserted replaced
6262:312d9c28da04 6263:6bd0726c74e2
  2452 
  2452 
  2453 	const Order *order = GetVehicleOrder(v, v->cur_order_index);
  2453 	const Order *order = GetVehicleOrder(v, v->cur_order_index);
  2454 
  2454 
  2455 	// If no order, do nothing.
  2455 	// If no order, do nothing.
  2456 	if (order == NULL) {
  2456 	if (order == NULL) {
  2457 		v->current_order.type = OT_NOTHING;
  2457 		v->current_order.Free();
  2458 		v->current_order.flags = 0;
       
  2459 		v->dest_tile = 0;
  2458 		v->dest_tile = 0;
  2460 		return false;
  2459 		return false;
  2461 	}
  2460 	}
  2462 
  2461 
  2463 	// If it is unchanged, keep it.
  2462 	// If it is unchanged, keep it.
  2908 						TrainEnterStation(v, r >> VETS_STATION_ID_OFFSET);
  2907 						TrainEnterStation(v, r >> VETS_STATION_ID_OFFSET);
  2909 						return;
  2908 						return;
  2910 					}
  2909 					}
  2911 
  2910 
  2912 					if (v->current_order.type == OT_LEAVESTATION) {
  2911 					if (v->current_order.type == OT_LEAVESTATION) {
  2913 						v->current_order.type = OT_NOTHING;
  2912 						v->current_order.Free();
  2914 						v->current_order.flags = 0;
       
  2915 						InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
  2913 						InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
  2916 					}
  2914 					}
  2917 				}
  2915 				}
  2918 			} else {
  2916 			} else {
  2919 				/* A new tile is about to be entered. */
  2917 				/* A new tile is about to be entered. */