diff src/economy.cpp @ 13054:1fa162c4d082 draft

(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.
author rubidium <rubidium@openttd.org>
date Tue, 15 Sep 2009 20:58:44 +0000 (2009-09-15)
parents a65b1859dfcd
children 082cdb4504ac
line wrap: on
line diff
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1069,7 +1069,7 @@
 	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 @@
 {
 	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 @@
 		/* 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 @@
 	}
 
 	/* 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);