mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-26 00:45:35 +00:00
Codechange: make IndustryAvailabilityCallType a scoped enum
This commit is contained in:
committed by
Peter Nelson
parent
89174e891a
commit
77be3fc12d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user