mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
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:
parent
e141734e54
commit
5751da7809
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user