@@ -83,27 +83,28 @@ bool IsHangar(TileIndex t)
*/
template <class T>
CommandCost GetStationAround(TileArea ta, StationID closest_station, T **st)
{
ta.tile -= TileDiffXY(1, 1);
ta.w += 2;
ta.h += 2;
/* check around to see if there's any stations there */
TILE_AREA_LOOP(tile_cur, ta) {
if (IsTileType(tile_cur, MP_STATION)) {
StationID t = GetStationIndex(tile_cur);
if (!T::IsValidID(t)) continue;
if (closest_station == INVALID_STATION) {
if (T::IsValidID(t)) closest_station = t;
closest_station = t;
} else if (closest_station != t) {
return_cmd_error(STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING);
}
*st = (closest_station == INVALID_STATION) ? NULL : T::Get(closest_station);
return CommandCost();
/**
* Function to check whether the given tile matches some criterion.
* @param tile the tile to check
Status change: