Changeset - r22600:b52b51b3fd73
[Not reviewed]
master
0 2 0
peter1138 - 7 years ago 2017-03-20 17:49:44
peter1138@openttd.org
(svn r27811) -Change: Remove unused parameters in FreeTrainTrackReservation

FreeTrainTrackReservation is always called with INVALID_TILE
and INVALID_TRACKDIR as second and third arguments, so remove
them and just use those constants instead. (cirdan)
2 files changed with 5 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/train.h
Show inline comments
 
@@ -61,7 +61,7 @@ byte FreightWagonMult(CargoID cargo);
 

	
 
void CheckTrainsLengths();
 

	
 
void FreeTrainTrackReservation(const Train *v, TileIndex origin = INVALID_TILE, Trackdir orig_td = INVALID_TRACKDIR);
 
void FreeTrainTrackReservation(const Train *v);
 
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);
src/train_cmd.cpp
Show inline comments
 
@@ -2254,16 +2254,14 @@ static void ClearPathReservation(const T
 
/**
 
 * Free the reserved path in front of a vehicle.
 
 * @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, TileIndex origin, Trackdir orig_td)
 
void FreeTrainTrackReservation(const Train *v)
 
{
 
	assert(v->IsFrontEngine());
 

	
 
	TileIndex tile = origin != INVALID_TILE ? origin : v->tile;
 
	Trackdir  td = orig_td != INVALID_TRACKDIR ? orig_td : v->GetVehicleTrackdir();
 
	bool      free_tile = tile != v->tile || !(IsRailStationTile(v->tile) || IsTileType(v->tile, MP_TUNNELBRIDGE));
 
	TileIndex tile = v->tile;
 
	Trackdir  td = v->GetVehicleTrackdir();
 
	bool      free_tile = !(IsRailStationTile(v->tile) || IsTileType(v->tile, MP_TUNNELBRIDGE));
 
	StationID station_id = IsRailStationTile(v->tile) ? GetStationIndex(v->tile) : INVALID_STATION;
 

	
 
	/* Can't be holding a reservation if we enter a depot. */
0 comments (0 inline, 0 general)