1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-25 21:24:12 +01:00

Codechange: make TownID an enum

This commit is contained in:
Rubidium
2025-01-19 15:18:47 +01:00
committed by rubidium42
parent cda9c2759e
commit cd4482b5df
9 changed files with 18 additions and 15 deletions

View File

@@ -1008,7 +1008,7 @@ bool AfterLoadGame()
if ((GB(t.m5(), 4, 2) == ROAD_TILE_CROSSING ? (Owner)t.m3() : GetTileOwner(t)) == OWNER_TOWN) {
SetTownIndex(t, CalcClosestTownFromTile(t)->index);
} else {
SetTownIndex(t, 0);
SetTownIndex(t, TOWN_BEGIN);
}
break;
@@ -1232,7 +1232,7 @@ bool AfterLoadGame()
GetRailType(t)
);
} else {
TownID town = IsTileOwner(t, OWNER_TOWN) ? ClosestTownFromTile(t, UINT_MAX)->index : 0;
TownID town = IsTileOwner(t, OWNER_TOWN) ? ClosestTownFromTile(t, UINT_MAX)->index : TOWN_BEGIN;
/* MakeRoadNormal */
SetTileType(t, MP_ROAD);