* Determines if a town is close to a tile. * @param tile TileIndex of the tile to query. * @param dist The maximum distance to be accepted. * @returns true if the tile is within the specified distance. */
| 388 | * @returns true if the tile is within the specified distance. |
| 389 | */ |
| 390 | static bool IsCloseToTown(TileIndex tile, uint dist) |
| 391 | { |
| 392 | if (_town_kdtree.Count() == 0) return false; |
| 393 | Town *t = Town::Get(_town_kdtree.FindNearest(TileX(tile), TileY(tile))); |
| 394 | return DistanceManhattan(tile, t->xy) < dist; |
| 395 | } |
| 396 | |
| 397 | /** Resize the sign (label) of the town after it changes population. */ |
| 398 | void Town::UpdateVirtCoord() |
no test coverage detected