summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-01-09 14:43:08 +0000
committerrubidium <rubidium@openttd.org>2010-01-09 14:43:08 +0000
commite4af35d316158767ddd19d87ac1c92086be7a71c (patch)
tree209595e66247eac0defe0806ff0f08706fc7adee /src/economy.cpp
parentf65f276d10e528ffe2581656cfa8066a20002995 (diff)
downloadopenttd-e4af35d316158767ddd19d87ac1c92086be7a71c.tar.xz
(svn r18764) -Fix [FS#3422]: split the (un)load ticks counter and signal wait counter; sometimes they might get into eachother's way
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 187b97b5d..83fa47b0b 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1084,7 +1084,7 @@ void PrepareUnload(Vehicle *front_v)
ClrBit(front_v->vehicle_flags, VF_LOADING_FINISHED);
/* Start unloading in at the first possible moment */
- front_v->time_counter = 1;
+ front_v->load_unload_ticks = 1;
if ((front_v->current_order.GetUnloadType() & OUFB_NO_UNLOAD) == 0) {
for (Vehicle *v = front_v; v != NULL; v = v->Next()) {
@@ -1110,10 +1110,10 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
{
assert(v->current_order.IsType(OT_LOADING));
- assert(v->time_counter != 0);
+ assert(v->load_unload_ticks != 0);
/* We have not waited enough time till the next round of loading/unloading */
- if (--v->time_counter != 0) {
+ if (--v->load_unload_ticks != 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()) {
@@ -1131,7 +1131,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->time_counter = 1;
+ v->load_unload_ticks = 1;
return;
}
@@ -1364,7 +1364,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
}
/* Always wait at least 1, otherwise we'll wait 'infinitively' long. */
- v->time_counter = max(1, unloading_time);
+ v->load_unload_ticks = max(1, unloading_time);
if (completely_emptied) {
TriggerVehicle(v, VEHICLE_TRIGGER_EMPTY);