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

@@ -491,7 +491,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
TileIndex tile = 0;
do {
ChangeTileOwner(tile, old_owner, new_owner);
} while (++tile != MapSize());
} while (++tile != Map::Size());
if (new_owner != INVALID_OWNER) {
/* Update all signals because there can be new segment that was owned by two companies
@@ -510,7 +510,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
} else if (IsLevelCrossingTile(tile) && IsTileOwner(tile, new_owner)) {
UpdateLevelCrossing(tile);
}
} while (++tile != MapSize());
} while (++tile != Map::Size());
}
/* update signals in buffer */
@@ -903,7 +903,7 @@ void SetPriceBaseMultiplier(Price price, int factor)
*/
void StartupIndustryDailyChanges(bool init_counter)
{
uint map_size = MapLogX() + MapLogY();
uint map_size = Map::LogX() + Map::LogY();
/* After getting map size, it needs to be scaled appropriately and divided by 31,
* which stands for the days in a month.
* Using just 31 will make it so that a monthly reset (based on the real number of days of that month)