(svn r16938) -Codechange: introduce helper function to tell whether a tile is either a rail station or rail waypoint tile

This commit is contained in:
rubidium
2009-07-24 11:15:11 +00:00
parent 36ebb4fe58
commit 00a9b2fd3d
12 changed files with 36 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ TrackBits GetReservedTrackbits(TileIndex t)
break;
case MP_STATION:
if (IsRailwayStation(t) || IsRailWaypoint(t)) return GetStationReservationTrackBits(t);
if (HasStationRail(t)) return GetStationReservationTrackBits(t);
break;
case MP_TUNNELBRIDGE:
@@ -99,7 +99,7 @@ bool TryReserveRailTrack(TileIndex tile, Track t)
break;
case MP_STATION:
if ((IsRailwayStation(tile) || IsRailWaypoint(tile)) && !HasStationReservation(tile)) {
if (HasStationRail(tile) && !HasStationReservation(tile)) {
SetRailwayStationReservation(tile, true);
MarkTileDirtyByTile(tile); // some GRFs need redraw after reserving track
return true;
@@ -150,7 +150,7 @@ bool TryReserveRailTrack(TileIndex tile, Track t)
break;
case MP_STATION:
if (IsRailwayStation(tile) || IsRailWaypoint(tile)) {
if (HasStationRail(tile)) {
SetRailwayStationReservation(tile, false);
MarkTileDirtyByTile(tile);
}