1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 14:44:28 +01:00

Codechange: Make EconomyType an enum class.

This commit is contained in:
Cyprian Klimaszewski
2026-01-12 23:28:49 +01:00
committed by rubidium42
parent 322ce224b4
commit 25184a23fc
3 changed files with 12 additions and 12 deletions

View File

@@ -2915,7 +2915,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
}
} else {
if (monthly == original_economy) return;
if (!original_economy && _settings_game.economy.type == ET_FROZEN) return;
if (!original_economy && _settings_game.economy.type == EconomyType::Frozen) return;
if (indspec->life_type == INDUSTRYLIFE_BLACK_HOLE) return;
}
@@ -2932,7 +2932,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
div = 1; // Decrease production
}
}
} else if (_settings_game.economy.type == ET_SMOOTH) {
} else if (_settings_game.economy.type == EconomyType::Smooth) {
closeit = !i->ctlflags.Any({IndustryControlFlag::NoClosure, IndustryControlFlag::NoProductionDecrease});
for (auto &p : i->produced) {
if (!IsValidCargoType(p.cargo)) continue;
@@ -3224,7 +3224,7 @@ Money IndustrySpec::GetRemovalCost() const
*/
bool IndustrySpec::UsesOriginalEconomy() const
{
return _settings_game.economy.type == ET_ORIGINAL ||
return _settings_game.economy.type == EconomyType::Original ||
this->callback_mask.Any({
IndustryCallbackMask::Production256Ticks,
IndustryCallbackMask::ProductionCargoArrival, // production callbacks