Changeset - r6844:9474c60d529d
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-06-10 20:27:28
rubidium@openttd.org
(svn r10084) -Fix [FS#855]: reversing a train when loading at a station crashed.
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/economy.cpp
Show inline comments
 
@@ -1459,24 +1459,31 @@ static void LoadUnloadVehicle(Vehicle *v
 

	
 
	/* We have not waited enough time till the next round of loading/unloading */
 
	if (--v->load_unload_time_rem != 0) {
 
		if (_patches.improved_load && HASBIT(v->current_order.flags, OFB_FULL_LOAD)) {
 
			/* 'Reserve' this cargo for this vehicle, because we were first. */
 
			for (; v != NULL; v = v->next) {
 
				if (v->cargo_cap != 0) cargo_left[v->cargo_type] -= v->cargo_cap - v->cargo_count;
 
			}
 
		}
 
		return;
 
	}
 

	
 
	if (v->type == VEH_TRAIN && !IsTileType(v->tile, MP_STATION)) {
 
		/* 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);
 
		return;
 
	}
 

	
 
	int unloading_time = 0;
 
	Vehicle *u = v;
 
	int result = 0;
 
	int cap;
 

	
 
	bool completely_empty  = true;
 
	bool anything_unloaded = false;
 
	bool anything_loaded   = false;
 
	uint32 cargo_not_full  = 0;
 
	uint32 cargo_full      = 0;
 
	int total_cargo_feeder_share = 0; // the feeder cash amount for the goods being loaded/unloaded in this load step
 

	
0 comments (0 inline, 0 general)