Codechange: Make TownRatingCheckType an enum class. (#14652)

This commit is contained in:
Peter Nelson
2025-09-23 22:00:34 +01:00
committed by GitHub
parent 2b164111a9
commit 484ed1008a
4 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -282,7 +282,7 @@ CommandCost CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, R
/* check if you're allowed to remove the street owned by a town
* removal allowance depends on difficulty setting */
CommandCost ret = CheckforTownRating(flags, t, ROAD_REMOVE);
CommandCost ret = CheckforTownRating(flags, t, TownRatingCheckType::RoadRemove);
if (ret.Failed()) return ret;
/* Get a bitmask of which neighbouring roads has a tile */
@@ -2492,7 +2492,7 @@ CommandCost CmdConvertRoad(DoCommandFlags flags, TileIndex tile, TileIndex area_
* acceptance of destructive actions. */
if (owner == OWNER_TOWN) {
Town *t = ClosestTownFromTile(tile, _settings_game.economy.dist_local_authority);
CommandCost ret = CheckforTownRating({}, t, tt == MP_TUNNELBRIDGE ? TUNNELBRIDGE_REMOVE : ROAD_REMOVE);
CommandCost ret = CheckforTownRating({}, t, tt == MP_TUNNELBRIDGE ? TownRatingCheckType::TunnelBridgeRemove : TownRatingCheckType::RoadRemove);
if (ret.Failed()) {
error = std::move(ret);
continue;