Changeset - r12457:fda18fe9b6c0
[Not reviewed]
master
0 3 0
rubidium - 15 years ago 2009-07-21 17:14:05
rubidium@openttd.org
(svn r16901) -Fix [FS#3046] (rpbs): when marking trains stuck don't reset the unload counter/stuck when the vehicle is unloading. It'll be automatically reset once the vehicle wants to leave the station
3 files changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/economy.cpp
Show inline comments
 
@@ -1256,6 +1256,7 @@ void PrepareUnload(Vehicle *front_v)
 
static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
 
{
 
	assert(v->current_order.IsType(OT_LOADING));
 
	assert(v->load_unload_time_rem != 0);
 

	
 
	/* We have not waited enough time till the next round of loading/unloading */
 
	if (--v->load_unload_time_rem != 0) {
src/train_cmd.cpp
Show inline comments
 
@@ -1644,6 +1644,10 @@ static void MarkTrainAsStuck(Train *v)
 
	if (!HasBit(v->flags, VRF_TRAIN_STUCK)) {
 
		/* It is the first time the problem occured, set the "train stuck" flag. */
 
		SetBit(v->flags, VRF_TRAIN_STUCK);
 

	
 
		/* When loading the vehicle is already stopped. No need to change that. */
 
		if (v->current_order.IsType(OT_LOADING)) return;
 

	
 
		v->load_unload_time_rem = 0;
 

	
 
		/* Stop train */
src/vehicle_gui.cpp
Show inline comments
 
@@ -1916,7 +1916,7 @@ struct VehicleViewWindow : Window {
 
			} else { // no train
 
				str = STR_VEHICLE_STATUS_STOPPED;
 
			}
 
		} else if (v->type == VEH_TRAIN && HasBit(Train::From(v)->flags, VRF_TRAIN_STUCK)) {
 
		} else if (v->type == VEH_TRAIN && HasBit(Train::From(v)->flags, VRF_TRAIN_STUCK) && !v->current_order.IsType(OT_LOADING)) {
 
			str = STR_TRAIN_STUCK;
 
		} else { // vehicle is in a "normal" state, show current order
 
			switch (v->current_order.GetType()) {
0 comments (0 inline, 0 general)