Merge branch 'tracerestrict' into tracerestrict-sx
# Conflicts: # src/saveload/company_sl.cpp # src/saveload/saveload.cpp
This commit is contained in:
		@@ -61,7 +61,7 @@ byte FreightWagonMult(CargoID cargo);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void CheckTrainsLengths();
 | 
					void CheckTrainsLengths();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void FreeTrainTrackReservation(const Train *v);
 | 
					void FreeTrainTrackReservation(const Train *v, TileIndex origin = INVALID_TILE, Trackdir orig_td = INVALID_TRACKDIR);
 | 
				
			||||||
bool TryPathReserve(Train *v, bool mark_as_stuck = false, bool first_tile_okay = false);
 | 
					bool TryPathReserve(Train *v, bool mark_as_stuck = false, bool first_tile_okay = false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int GetTrainStopLocation(StationID station_id, TileIndex tile, const Train *v, int *station_ahead, int *station_length);
 | 
					int GetTrainStopLocation(StationID station_id, TileIndex tile, const Train *v, int *station_ahead, int *station_length);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2256,14 +2256,16 @@ static void ClearPathReservation(const Train *v, TileIndex tile, Trackdir track_
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * Free the reserved path in front of a vehicle.
 | 
					 * Free the reserved path in front of a vehicle.
 | 
				
			||||||
 * @param v %Train owning the reserved path.
 | 
					 * @param v %Train owning the reserved path.
 | 
				
			||||||
 | 
					 * @param origin %Tile to start clearing (if #INVALID_TILE, use the current tile of \a v).
 | 
				
			||||||
 | 
					 * @param orig_td Track direction (if #INVALID_TRACKDIR, use the track direction of \a v).
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void FreeTrainTrackReservation(const Train *v)
 | 
					void FreeTrainTrackReservation(const Train *v, TileIndex origin, Trackdir orig_td)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	assert(v->IsFrontEngine());
 | 
						assert(v->IsFrontEngine());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TileIndex tile = v->tile;
 | 
						TileIndex tile = origin != INVALID_TILE ? origin : v->tile;
 | 
				
			||||||
	Trackdir  td = v->GetVehicleTrackdir();
 | 
						Trackdir  td = orig_td != INVALID_TRACKDIR ? orig_td : v->GetVehicleTrackdir();
 | 
				
			||||||
	bool      free_tile = !(IsRailStationTile(v->tile) || IsTileType(v->tile, MP_TUNNELBRIDGE));
 | 
						bool      free_tile = tile != v->tile || !(IsRailStationTile(v->tile) || IsTileType(v->tile, MP_TUNNELBRIDGE));
 | 
				
			||||||
	StationID station_id = IsRailStationTile(v->tile) ? GetStationIndex(v->tile) : INVALID_STATION;
 | 
						StationID station_id = IsRailStationTile(v->tile) ? GetStationIndex(v->tile) : INVALID_STATION;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Can't be holding a reservation if we enter a depot. */
 | 
						/* Can't be holding a reservation if we enter a depot. */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user