summaryrefslogtreecommitdiff
path: root/src/script/api/script_industry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/script_industry.cpp')
-rw-r--r--src/script/api/script_industry.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/api/script_industry.cpp b/src/script/api/script_industry.cpp
index afcaee554..ca0eaafc4 100644
--- a/src/script/api/script_industry.cpp
+++ b/src/script/api/script_industry.cpp
@@ -60,7 +60,7 @@
}
EnforcePrecondition(false, IsValidIndustry(industry_id));
- return ScriptObject::Command<CMD_INDUSTRY_CTRL>::Do(0, industry_id, static_cast<uint32>(IndustryAction::SetText), std::string{ encoded_text ? encoded_text : "" });
+ return ScriptObject::Command<CMD_INDUSTRY_CTRL>::Do(industry_id, IndustryAction::SetText, INDCTL_NONE, INVALID_OWNER, std::string{ encoded_text ? encoded_text : "" });
}
/* static */ ScriptIndustry::CargoAcceptState ScriptIndustry::IsCargoAccepted(IndustryID industry_id, CargoID cargo_id)
@@ -258,7 +258,7 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag
if (ScriptObject::GetCompany() != OWNER_DEITY) return false;
if (!IsValidIndustry(industry_id)) return false;
- return ScriptObject::Command<CMD_INDUSTRY_CTRL>::Do(0, industry_id, 0 | ((control_flags & ::INDCTL_MASK) << 8), {});
+ return ScriptObject::Command<CMD_INDUSTRY_CTRL>::Do(industry_id, IndustryAction::SetControlFlags, (::IndustryControlFlags)control_flags & ::INDCTL_MASK, INVALID_OWNER, {});
}
/* static */ ScriptCompany::CompanyID ScriptIndustry::GetExclusiveSupplier(IndustryID industry_id)
@@ -277,7 +277,7 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag
auto company = ScriptCompany::ResolveCompanyID(company_id);
::Owner owner = (company == ScriptCompany::COMPANY_INVALID ? ::INVALID_OWNER : (::Owner)company);
- return ScriptObject::Command<CMD_INDUSTRY_CTRL>::Do(0, industry_id, 1 | (((uint8)owner) << 16), {});
+ return ScriptObject::Command<CMD_INDUSTRY_CTRL>::Do(industry_id, IndustryAction::SetExclusiveSupplier, INDCTL_NONE, owner, {});
}
/* static */ ScriptCompany::CompanyID ScriptIndustry::GetExclusiveConsumer(IndustryID industry_id)
@@ -296,5 +296,5 @@ bool ScriptIndustry::SetControlFlags(IndustryID industry_id, uint32 control_flag
auto company = ScriptCompany::ResolveCompanyID(company_id);
::Owner owner = (company == ScriptCompany::COMPANY_INVALID ? ::INVALID_OWNER : (::Owner)company);
- return ScriptObject::Command<CMD_INDUSTRY_CTRL>::Do(0, industry_id, 2 | (((uint8)owner) << 16), {});
+ return ScriptObject::Command<CMD_INDUSTRY_CTRL>::Do(industry_id, IndustryAction::SetExclusiveConsumer, INDCTL_NONE, owner, {});
}