Fix: Vehicle leaves station without loading if there is a per-cargo "no load" order for the currently fitted cargo.

pull/155/head
TechGeekNZ 4 years ago
parent 00b1fe6246
commit 082404e443

@ -1754,8 +1754,9 @@ static void LoadUnloadVehicle(Vehicle *front)
continue;
}
/* Do not pick up goods when we have no-load set or loading is stopped. */
if (GetLoadType(v) & OLFB_NO_LOAD || HasBit(front->vehicle_flags, VF_STOP_LOADING)) continue;
/* Do not pick up goods when we have no-load set or loading is stopped.
* Per-cargo no-load orders can only be checked after attempting to refit. */
if (front->current_order.GetLoadType() & OLFB_NO_LOAD || HasBit(front->vehicle_flags, VF_STOP_LOADING)) continue;
/* This order has a refit, if this is the first vehicle part carrying cargo and the whole vehicle is empty, try refitting. */
if (front->current_order.IsRefit() && artic_part == 1) {
@ -1763,6 +1764,9 @@ static void LoadUnloadVehicle(Vehicle *front)
ge = &st->goods[v->cargo_type];
}
/* Do not pick up goods when we have no-load set. */
if (GetLoadType(v) & OLFB_NO_LOAD) continue;
/* As we're loading here the following link can carry the full capacity of the vehicle. */
v->refit_cap = v->cargo_cap;

Loading…
Cancel
Save