(svn r16655) -Codechange: use IsRailwayStationTile() more

This commit is contained in:
smatz 2009-06-25 15:54:06 +00:00
parent fa1ad0fd3c
commit 38477f2b36
4 changed files with 4 additions and 5 deletions

View File

@ -747,7 +747,7 @@ void DeallocateSpecFromStation(Station *st, byte specindex)
/* Check all tiles over the station to check if the specindex is still in use */ /* Check all tiles over the station to check if the specindex is still in use */
BEGIN_TILE_LOOP(tile, st->trainst_w, st->trainst_h, st->train_tile) { BEGIN_TILE_LOOP(tile, st->trainst_w, st->trainst_h, st->train_tile) {
if (IsTileType(tile, MP_STATION) && GetStationIndex(tile) == st->index && IsRailwayStation(tile) && GetCustomStationSpecIndex(tile) == specindex) { if (IsRailwayStationTile(tile) && GetStationIndex(tile) == st->index && GetCustomStationSpecIndex(tile) == specindex) {
return; return;
} }
} END_TILE_LOOP(tile, st->trainst_w, st->trainst_h, st->train_tile) } END_TILE_LOOP(tile, st->trainst_w, st->trainst_h, st->train_tile)

View File

@ -188,7 +188,7 @@ void Station::MarkTilesDirty(bool cargo_change) const
bool Station::TileBelongsToRailStation(TileIndex tile) const bool Station::TileBelongsToRailStation(TileIndex tile) const
{ {
return IsTileType(tile, MP_STATION) && GetStationIndex(tile) == index && IsRailwayStation(tile); return IsRailwayStationTile(tile) && GetStationIndex(tile) = this->index;
} }
/** Obtain the length of a platform /** Obtain the length of a platform

View File

@ -1171,7 +1171,7 @@ CommandCost CmdRemoveFromRailroadStation(TileIndex tile, DoCommandFlag flags, ui
/* Do the action for every tile into the area */ /* Do the action for every tile into the area */
BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) { BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
/* Make sure the specified tile is a railroad station */ /* Make sure the specified tile is a railroad station */
if (!IsTileType(tile2, MP_STATION) || !IsRailwayStation(tile2)) { if (!IsRailwayStationTile(tile2)) {
continue; continue;
} }

View File

@ -2574,8 +2574,7 @@ static bool NtpCallbFindStation(TileIndex tile, TrainTrackFollowerData *ttfd, Tr
/* did we reach the final station? */ /* did we reach the final station? */
if ((ttfd->station_index == INVALID_STATION && tile == ttfd->dest_coords) || ( if ((ttfd->station_index == INVALID_STATION && tile == ttfd->dest_coords) || (
IsTileType(tile, MP_STATION) && IsRailwayStationTile(tile) &&
IsRailwayStation(tile) &&
GetStationIndex(tile) == ttfd->station_index GetStationIndex(tile) == ttfd->station_index
)) { )) {
/* We do not check for dest_coords if we have a station_index, /* We do not check for dest_coords if we have a station_index,