Fix #7982: Show existing coverage with unambiguous adjacent station (#12346)

When hovering a tile containing a station, show existing coverage for
that station even when adjacent to a different station.

Co-authored-by: Peter Nelson <peter@fuzzle.org>
This commit is contained in:
raddari 2024-03-23 00:03:16 +10:30 committed by GitHub
parent e141734e54
commit 5751da7809
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -92,6 +92,15 @@ void FindStationsAroundSelection()
/* Tile area for TileHighlightData */
TileArea location(TileVirtXY(_thd.pos.x, _thd.pos.y), _thd.size.x / TILE_SIZE - 1, _thd.size.y / TILE_SIZE - 1);
/* If the current tile is already a station, then it must be the nearest station. */
if (IsTileType(location.tile, MP_STATION) && GetTileOwner(location.tile) == _local_company) {
T* st = T::GetByTile(location.tile);
if (st != nullptr) {
SetViewportCatchmentSpecializedStation<T>(st, true);
return;
}
}
/* Extended area by one tile */
uint x = TileX(location.tile);
uint y = TileY(location.tile);