Changeset - r12861:5309cab2b296
[Not reviewed]
master
0 3 0
rubidium - 15 years ago 2009-09-01 21:54:59
rubidium@openttd.org
(svn r17363) -Fix [FS#3163] (r16717): feed autoreplace the front of vehicles, otherwise it gets distracted and bails out
3 files changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -2419,7 +2419,7 @@ static VehicleEnterTileStatus VehicleEnt
 
			v->track = TRACK_BIT_DEPOT,
 
			v->vehstatus |= VS_HIDDEN; // hide it
 
			v->direction = ReverseDir(v->direction);
 
			if (v->Next() == NULL) VehicleEnterDepot(v);
 
			if (v->Next() == NULL) VehicleEnterDepot(v->First());
 
			v->tile = tile;
 

	
 
			InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
src/road_cmd.cpp
Show inline comments
 
@@ -1550,7 +1550,7 @@ static VehicleEnterTileStatus VehicleEnt
 
				rv->state = RVSB_IN_DEPOT;
 
				rv->vehstatus |= VS_HIDDEN;
 
				rv->direction = ReverseDir(rv->direction);
 
				if (rv->Next() == NULL) VehicleEnterDepot(rv);
 
				if (rv->Next() == NULL) VehicleEnterDepot(rv->First());
 
				rv->tile = tile;
 

	
 
				InvalidateWindowData(WC_VEHICLE_DEPOT, rv->tile);
src/vehicle.cpp
Show inline comments
 
@@ -954,6 +954,9 @@ uint8 CalcPercentVehicleFilled(const Veh
 

	
 
void VehicleEnterDepot(Vehicle *v)
 
{
 
	/* Always work with the front of the vehicle */
 
	assert(v == v->First());
 

	
 
	switch (v->type) {
 
		case VEH_TRAIN: {
 
			Train *t = Train::From(v);
 
@@ -962,7 +965,6 @@ void VehicleEnterDepot(Vehicle *v)
 
			SetDepotReservation(t->tile, false);
 
			if (_settings_client.gui.show_track_reservation) MarkTileDirtyByTile(t->tile);
 

	
 
			if (!t->IsFrontEngine()) t = t->First();
 
			UpdateSignalsOnSegment(t->tile, INVALID_DIAGDIR, t->owner);
 
			t->load_unload_time_rem = 0;
 
			ClrBit(t->flags, VRF_TOGGLE_REVERSE);
 
@@ -972,7 +974,6 @@ void VehicleEnterDepot(Vehicle *v)
 

	
 
		case VEH_ROAD:
 
			InvalidateWindowClasses(WC_ROADVEH_LIST);
 
			if (!RoadVehicle::From(v)->IsRoadVehFront()) v = v->First();
 
			break;
 

	
 
		case VEH_SHIP:
0 comments (0 inline, 0 general)