Changeset - r15341:53ae0ca46a92
[Not reviewed]
master
0 2 0
frosch - 14 years ago 2010-06-16 20:27:59
frosch@openttd.org
(svn r19992) -Fix [FS#3878]: Clear force_proceed when entering depots and when loading.
-Fix (r18515): Resetting of force_proceed on manual stopping did not work.
2 files changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -2902,12 +2902,15 @@ static void TrainEnterStation(Train *v, 
 
			v->index,
 
			st->index
 
		);
 
		AI::NewEvent(v->owner, new AIEventStationFirstVehicle(st->index, v->index));
 
	}
 

	
 
	v->force_proceed = 0;
 
	SetWindowDirty(WC_VEHICLE_VIEW, v->index);
 

	
 
	v->BeginLoading();
 

	
 
	StationAnimationTrigger(st, v->tile, STAT_ANIM_TRAIN_ARRIVES);
 
}
 

	
 
/* Check if the vehicle is compatible with the specified tile */
 
@@ -3873,16 +3876,16 @@ static bool TrainLocoHandler(Train *v, b
 
		return true;
 
	}
 

	
 
	int j = v->UpdateSpeed();
 

	
 
	/* we need to invalidate the widget if we are stopping from 'Stopping 0 km/h' to 'Stopped' */
 
	if (v->cur_speed == 0 && v->tcache.last_speed == 0 && (v->vehstatus & VS_STOPPED)) {
 
	if (v->cur_speed == 0 && (v->vehstatus & VS_STOPPED)) {
 
		/* If we manually stopped, we're not force-proceeding anymore. */
 
		v->force_proceed = 0;
 
		SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 
		SetWindowDirty(WC_VEHICLE_VIEW, v->index);
 
	}
 

	
 
	int adv_spd = (v->direction & 1) ? 192 : 256;
 
	if (j < adv_spd) {
 
		/* if the vehicle has speed 0, update the last_speed field. */
 
		if (v->cur_speed == 0) SetLastSpeed(v, v->cur_speed);
src/vehicle.cpp
Show inline comments
 
@@ -1058,12 +1058,13 @@ void VehicleEnterDepot(Vehicle *v)
 
			/* Clear path reservation */
 
			SetDepotReservation(t->tile, false);
 
			if (_settings_client.gui.show_track_reservation) MarkTileDirtyByTile(t->tile);
 

	
 
			UpdateSignalsOnSegment(t->tile, INVALID_DIAGDIR, t->owner);
 
			t->wait_counter = 0;
 
			t->force_proceed = 0;
 
			ClrBit(t->flags, VRF_TOGGLE_REVERSE);
 
			t->ConsistChanged(true);
 
			break;
 
		}
 

	
 
		case VEH_ROAD:
 
@@ -1079,12 +1080,13 @@ void VehicleEnterDepot(Vehicle *v)
 
		case VEH_AIRCRAFT:
 
			SetWindowClassesDirty(WC_AIRCRAFT_LIST);
 
			HandleAircraftEnterHangar(Aircraft::From(v));
 
			break;
 
		default: NOT_REACHED();
 
	}
 
	SetWindowDirty(WC_VEHICLE_VIEW, v->index);
 

	
 
	if (v->type != VEH_TRAIN) {
 
		/* Trains update the vehicle list when the first unit enters the depot and calls VehicleEnterDepot() when the last unit enters.
 
		 * We only increase the number of vehicles when the first one enters, so we will not need to search for more vehicles in the depot */
 
		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 
	}
0 comments (0 inline, 0 general)