Merge branch 'master' into jgrpp

# Conflicts:
#	src/base_station_base.h
#	src/industry.h
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/lang/korean.txt
#	src/os/macosx/crashlog_osx.cpp
#	src/station_cmd.cpp
#	src/town.h
#	src/town_cmd.cpp
#	src/town_gui.cpp
This commit is contained in:
Jonathan G Rennison
2020-01-20 18:36:55 +00:00
39 changed files with 604 additions and 225 deletions

View File

@@ -2330,21 +2330,19 @@ void Industry::RecomputeProductionMultipliers()
}
}
void Industry::FillCachedName()
void Industry::FillCachedName() const
{
char buf[256];
int64 args_array[] = { this->index };
StringParameters tmp_params(args_array);
char *end = GetStringWithArgs(buf, STR_INDUSTRY_NAME, &tmp_params, lastof(buf));
char *alloced = MallocT<char>(end - buf + 1);
memcpy(alloced, buf, end - buf + 1);
this->cached_name.reset(alloced);
this->cached_name.assign(buf, end);
}
void ClearAllIndustryCachedNames()
{
for (Industry *ind : Industry::Iterate()) {
ind->cached_name.reset();
ind->cached_name.clear();
}
}