Codechange: Use EnumBitSet for HouseZones. (#14137)

This commit is contained in:
Peter Nelson
2025-04-28 20:27:43 +01:00
committed by GitHub
parent f5a9eae8b1
commit 2c4897c2cd
20 changed files with 238 additions and 233 deletions

View File

@@ -281,7 +281,7 @@ CommandCost CmdBuildBridge(DoCommandFlags flags, TileIndex tile_end, TileIndex t
company = OWNER_TOWN;
/* If we are not within a town, we are not owned by the town */
if (town == nullptr || DistanceSquare(tile_start, town->xy) > town->cache.squared_town_zone_radius[HZB_TOWN_EDGE]) {
if (town == nullptr || DistanceSquare(tile_start, town->xy) > town->cache.squared_town_zone_radius[to_underlying(HouseZone::TownEdge)]) {
company = OWNER_NONE;
}
}
@@ -635,7 +635,7 @@ CommandCost CmdBuildTunnel(DoCommandFlags flags, TileIndex start_tile, Transport
company = OWNER_TOWN;
/* If we are not within a town, we are not owned by the town */
if (town == nullptr || DistanceSquare(start_tile, town->xy) > town->cache.squared_town_zone_radius[HZB_TOWN_EDGE]) {
if (town == nullptr || DistanceSquare(start_tile, town->xy) > town->cache.squared_town_zone_radius[to_underlying(HouseZone::TownEdge)]) {
company = OWNER_NONE;
}
}