1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-21 21:49:10 +00:00

(svn r7326) -Feature: Add support for gradual (un)loading of vehicles (Maedhros)

This commit is contained in:
2006-12-02 16:56:32 +00:00
parent 6a4d8fdd33
commit 039794e83c
16 changed files with 155 additions and 86 deletions

View File

@@ -2609,10 +2609,11 @@ static void HandleTrainLoading(Vehicle *v, bool mode)
if (--v->load_unload_time_rem) return;
if (v->current_order.flags & OF_FULL_LOAD && CanFillVehicle(v)) {
if (CanFillVehicle(v) && (v->current_order.flags & OF_FULL_LOAD ||
(_patches.gradual_loading && !HASBIT(v->load_status, LS_LOADING_FINISHED)))) {
v->u.rail.days_since_order_progr = 0; /* Prevent a train lost message for full loading trains */
SET_EXPENSES_TYPE(EXPENSES_TRAIN_INC);
if (LoadUnloadVehicle(v)) {
if (LoadUnloadVehicle(v, false)) {
InvalidateWindow(WC_TRAINS_LIST, v->owner);
MarkTrainDirty(v);
@@ -2712,7 +2713,7 @@ static void TrainEnterStation(Vehicle *v, StationID station)
v->current_order.dest = 0;
SET_EXPENSES_TYPE(EXPENSES_TRAIN_INC);
if (LoadUnloadVehicle(v) != 0) {
if (LoadUnloadVehicle(v, true) != 0) {
InvalidateWindow(WC_TRAINS_LIST, v->owner);
TrainCargoChanged(v);
UpdateTrainAcceleration(v);