1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 13:09:15 +00:00

Codechange: Pass more std::string to StringFilter::AddLine() (#10743)

This commit is contained in:
Tyler Trahan
2023-04-30 04:23:05 -04:00
committed by GitHub
parent ee9239d293
commit ba3de0383a
10 changed files with 28 additions and 24 deletions

View File

@@ -1458,7 +1458,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
static bool use_cache = true;
if (use_cache) { // Use cached version if first call
AutoRestoreBackup cache_backup(use_cache, false);
buff = strecpy(buff, i->GetCachedName(), last);
buff = strecpy(buff, i->GetCachedName().c_str(), last);
} else if (_scan_for_gender_data) {
/* Gender is defined by the industry type.
* STR_FORMAT_INDUSTRY_NAME may have the town first, so it would result in the gender of the town name */
@@ -1541,7 +1541,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
static bool use_cache = true;
if (use_cache) { // Use cached version if first call
AutoRestoreBackup cache_backup(use_cache, false);
buff = strecpy(buff, t->GetCachedName(), last);
buff = strecpy(buff, t->GetCachedName().c_str(), last);
} else if (!t->name.empty()) {
int64 args_array[] = {(int64)(size_t)t->name.c_str()};
StringParameters tmp_params(args_array);