diff options
author | rubidium <rubidium@openttd.org> | 2009-09-15 20:58:44 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-09-15 20:58:44 +0000 |
commit | af457fc9fe53686de6210c0bf8ec488993e22f56 (patch) | |
tree | 76f42c210572514a2f0053304b1063ea8b6e2b0f /src/economy.cpp | |
parent | e9ae22d2c554814cf256a95dde841cea30a86a3e (diff) | |
download | openttd-af457fc9fe53686de6210c0bf8ec488993e22f56.tar.xz |
(svn r17552) -Codechange: rename load_unload_time_rem to something more generic as it's used for more than just load/unload. Also add some documentation about where it is used.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index 77dd93109..c5b3666f5 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1069,7 +1069,7 @@ void PrepareUnload(Vehicle *front_v) ClrBit(front_v->vehicle_flags, VF_LOADING_FINISHED); /* Start unloading in at the first possible moment */ - front_v->load_unload_time_rem = 1; + front_v->time_counter = 1; if ((front_v->current_order.GetUnloadType() & OUFB_NO_UNLOAD) == 0) { for (Vehicle *v = front_v; v != NULL; v = v->Next()) { @@ -1095,10 +1095,10 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) { assert(v->current_order.IsType(OT_LOADING)); - assert(v->load_unload_time_rem != 0); + assert(v->time_counter != 0); /* We have not waited enough time till the next round of loading/unloading */ - if (--v->load_unload_time_rem != 0) { + if (--v->time_counter != 0) { if (_settings_game.order.improved_load && (v->current_order.GetLoadType() & OLFB_FULL_LOAD)) { /* 'Reserve' this cargo for this vehicle, because we were first. */ for (; v != NULL; v = v->Next()) { @@ -1116,7 +1116,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) /* The train reversed in the station. Take the "easy" way * out and let the train just leave as it always did. */ SetBit(v->vehicle_flags, VF_LOADING_FINISHED); - v->load_unload_time_rem = 1; + v->time_counter = 1; return; } @@ -1347,7 +1347,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left) } /* Always wait at least 1, otherwise we'll wait 'infinitively' long. */ - v->load_unload_time_rem = max(1, unloading_time); + v->time_counter = max(1, unloading_time); if (completely_emptied) { TriggerVehicle(v, VEHICLE_TRIGGER_EMPTY); |