Codechange: Use EnumBitSet for TownFlags. (#14651)

This commit is contained in:
Peter Nelson
2025-09-22 20:04:55 +01:00
committed by GitHub
parent 43e65d04e4
commit 2b164111a9
5 changed files with 31 additions and 35 deletions

View File

@@ -3120,7 +3120,7 @@ bool AfterLoadGame()
/* Convert towns growth_rate and grow_counter to ticks */
for (Town *t : Town::Iterate()) {
/* 0x8000 = TOWN_GROWTH_RATE_CUSTOM previously */
if (t->growth_rate & 0x8000) SetBit(t->flags, TOWN_CUSTOM_GROWTH);
if (t->growth_rate & 0x8000) t->flags.Set(TownFlag::CustomGrowth);
if (t->growth_rate != TOWN_GROWTH_RATE_NONE) {
t->growth_rate = TownTicksToGameTicks(t->growth_rate & ~0x8000);
}