src/train_cmd.cpp
changeset 8922 88bec308f864
parent 8886 9f2c7ebc7fc9
child 8963 4b41ed1df7e5
equal deleted inserted replaced
8921:6d9c1a813d88 8922:88bec308f864
  3521 	if (CheckTrainStayInDepot(v)) return;
  3521 	if (CheckTrainStayInDepot(v)) return;
  3522 
  3522 
  3523 	if (!mode) HandleLocomotiveSmokeCloud(v);
  3523 	if (!mode) HandleLocomotiveSmokeCloud(v);
  3524 
  3524 
  3525 	int j = UpdateTrainSpeed(v);
  3525 	int j = UpdateTrainSpeed(v);
       
  3526 
       
  3527 	/* we need to invalidate the widget if we are stopping from 'Stopping 0 km/h' to 'Stopped' */
       
  3528 	if (v->cur_speed == 0 && v->u.rail.last_speed == 0 && v->vehstatus & VS_STOPPED) {
       
  3529 		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
       
  3530 	}
       
  3531 
  3526 	if (j == 0) {
  3532 	if (j == 0) {
  3527 		/* if the vehicle has speed 0, update the last_speed field. */
  3533 		/* if the vehicle has speed 0, update the last_speed field. */
  3528 		if (v->cur_speed != 0) return;
  3534 		if (v->cur_speed != 0) return;
  3529 	} else {
  3535 	} else {
  3530 		TrainCheckIfLineEnds(v);
  3536 		TrainCheckIfLineEnds(v);