Codechange: make IndustryAvailabilityCallType a scoped enum

This commit is contained in:
Peter Nelson
2026-04-30 22:40:20 +01:00
committed by Peter Nelson
parent 89174e891a
commit 77be3fc12d
6 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -96,7 +96,7 @@
if (!IsValidIndustryType(industry_type)) return false;
const bool deity = ScriptCompanyMode::IsDeity();
if (::GetIndustryProbabilityCallback(industry_type, deity ? IACT_RANDOMCREATION : IACT_USERCREATION, 1) == 0) return false;
if (::GetIndustryProbabilityCallback(industry_type, deity ? IndustryAvailabilityCallType::RandomCreation : IndustryAvailabilityCallType::UserCreation, 1) == 0) return false;
if (deity) return true;
if (!::GetIndustrySpec(industry_type)->IsRawIndustry()) return true;
@@ -110,7 +110,7 @@
const bool deity = ScriptCompanyMode::IsDeity();
if (!deity && !::GetIndustrySpec(industry_type)->IsRawIndustry()) return false;
if (::GetIndustryProbabilityCallback(industry_type, deity ? IACT_RANDOMCREATION : IACT_USERCREATION, 1) == 0) return false;
if (::GetIndustryProbabilityCallback(industry_type, deity ? IndustryAvailabilityCallType::RandomCreation : IndustryAvailabilityCallType::UserCreation, 1) == 0) return false;
/* raw_industry_construction == 2 means "prospect" */
return deity || _settings_game.construction.raw_industry_construction == 2;