|
@@ -100,13 +100,13 @@ static void FindStationsAroundSelection(
|
|
|
int max_c = 1;
|
|
|
TileArea ta(TileXY(std::max<int>(0, x - max_c), std::max<int>(0, y - max_c)), TileXY(std::min<int>(MapMaxX(), x + location.w + max_c), std::min<int>(MapMaxY(), y + location.h + max_c)));
|
|
|
|
|
|
Station *adjacent = nullptr;
|
|
|
|
|
|
/* Direct loop instead of ForAllStationsAroundTiles as we are not interested in catchment area */
|
|
|
TILE_AREA_LOOP(tile, ta) {
|
|
|
for (TileIndex tile : ta) {
|
|
|
if (IsTileType(tile, MP_STATION) && GetTileOwner(tile) == _local_company) {
|
|
|
Station *st = Station::GetByTile(tile);
|
|
|
if (st == nullptr) continue;
|
|
|
if (adjacent != nullptr && st != adjacent) {
|
|
|
/* Multiple nearby, distant join is required. */
|
|
|
adjacent = nullptr;
|
|
@@ -2211,13 +2211,13 @@ static const T *FindStationsNearby(TileA
|
|
|
TileArea ctx = ta;
|
|
|
|
|
|
_stations_nearby_list.clear();
|
|
|
_deleted_stations_nearby.clear();
|
|
|
|
|
|
/* Check the inside, to return, if we sit on another station */
|
|
|
TILE_AREA_LOOP(t, ta) {
|
|
|
for (TileIndex t : ta) {
|
|
|
if (t < MapSize() && IsTileType(t, MP_STATION) && T::IsValidID(GetStationIndex(t))) return T::GetByTile(t);
|
|
|
}
|
|
|
|
|
|
/* Look for deleted stations */
|
|
|
for (const BaseStation *st : BaseStation::Iterate()) {
|
|
|
if (T::IsExpected(st) && !st->IsInUse() && st->owner == _local_company) {
|