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.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/script/api/script_industry.cpp b/src/script/api/script_industry.cpp
index 5d76bb005..5e30f1377 100644
--- a/src/script/api/script_industry.cpp
+++ b/src/script/api/script_industry.cpp
@@ -38,13 +38,9 @@
/* static */ char *ScriptIndustry::GetName(IndustryID industry_id)
{
if (!IsValidIndustry(industry_id)) return NULL;
- static const int len = 64;
- char *industry_name = MallocT<char>(len);
::SetDParam(0, industry_id);
- ::GetString(industry_name, STR_INDUSTRY_NAME, &industry_name[len - 1]);
-
- return industry_name;
+ return GetString(STR_INDUSTRY_NAME);
}
/* static */ ScriptIndustry::CargoAcceptState ScriptIndustry::IsCargoAccepted(IndustryID industry_id, CargoID cargo_id)