Merge branch 'master' into tracerestrict

# Conflicts:
#	src/saveload/saveload.cpp
This commit is contained in:
Jonathan G Rennison
2017-03-20 19:14:48 +00:00
145 changed files with 1135 additions and 1006 deletions

View File

@@ -1702,8 +1702,8 @@ void UpdateLevelCrossing(TileIndex tile, bool sound)
{
assert(IsLevelCrossingTile(tile));
/* train on crossing || train approaching crossing || reserved */
bool new_state = HasVehicleOnPos(tile, NULL, &TrainOnTileEnum) || TrainApproachingCrossing(tile) || HasCrossingReservation(tile);
/* reserved || train on crossing || train approaching crossing */
bool new_state = HasCrossingReservation(tile) || HasVehicleOnPos(tile, NULL, &TrainOnTileEnum) || TrainApproachingCrossing(tile);
if (new_state != IsCrossingBarred(tile)) {
if (new_state && sound) {
@@ -2256,16 +2256,14 @@ static void ClearPathReservation(const Train *v, TileIndex tile, Trackdir track_
/**
* 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. */