@@ -2324,25 +2324,25 @@ void Vehicle::ResetRefitCaps()
for (Vehicle *v = this; v != nullptr; v = v->Next()) v->refit_cap = v->cargo_cap;
}
/**
* Handle the loading of the vehicle; when not it skips through dummy
* orders and does nothing in all other cases.
* @param mode is the non-first call for this vehicle in this tick?
*/
void Vehicle::HandleLoading(bool mode)
{
switch (this->current_order.GetType()) {
case OT_LOADING: {
uint wait_time = std::max(this->current_order.GetTimetabledWait() - this->lateness_counter, 0);
TimerGameTick::Ticks wait_time = std::max(this->current_order.GetTimetabledWait() - this->lateness_counter, 0);
/* Not the first call for this tick, or still loading */
if (mode || !HasBit(this->vehicle_flags, VF_LOADING_FINISHED) || this->current_order_time < wait_time) return;
this->PlayLeaveStationSound();
this->LeaveStation();
/* Only advance to next order if we just loaded at the current one */
const Order *order = this->GetOrder(this->cur_implicit_order_index);
if (order == nullptr ||
(!order->IsType(OT_IMPLICIT) && !order->IsType(OT_GOTO_STATION)) ||