Codechange: migrate size related functions to Map structure

This commit is contained in:
Rubidium
2023-01-21 10:43:03 +01:00
committed by rubidium42
parent d481f78b24
commit fe2bcd2a58
56 changed files with 334 additions and 343 deletions

View File

@@ -104,14 +104,14 @@ void MoveWaypointsToBaseStations()
* the map array. If this is the case, try to locate the actual location in the map array */
if (!IsTileType(t, MP_RAILWAY) || GetRailTileType(t) != 2 /* RAIL_TILE_WAYPOINT */ || _m[t].m2 != wp.index) {
Debug(sl, 0, "Found waypoint tile {} with invalid position", t);
for (t = 0; t < MapSize(); t++) {
for (t = 0; t < Map::Size(); t++) {
if (IsTileType(t, MP_RAILWAY) && GetRailTileType(t) == 2 /* RAIL_TILE_WAYPOINT */ && _m[t].m2 == wp.index) {
Debug(sl, 0, "Found actual waypoint position at {}", t);
break;
}
}
}
if (t == MapSize()) {
if (t == Map::Size()) {
SlErrorCorrupt("Waypoint with invalid tile");
}