diff options
author | frosch <frosch@openttd.org> | 2012-09-12 18:52:11 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-09-12 18:52:11 +0000 |
commit | bd173618173e0cdf6477e1df4f715cc486779828 (patch) | |
tree | 27b1f94a28606b7f4a783e094cb03736f60d06bc /src | |
parent | c7a536a6d8486f522a286e259f179f33b1f6711c (diff) | |
download | openttd-bd173618173e0cdf6477e1df4f715cc486779828.tar.xz |
(svn r24523) -Fix: The gender of an industry name is defined by the industry-type part of the name, not by the town-name part, even if it comes first.
Diffstat (limited to 'src')
-rw-r--r-- | src/strings.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index b0160f397..2449c5c09 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1313,11 +1313,18 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg const Industry *i = Industry::GetIfValid(args->GetInt32(SCC_INDUSTRY_NAME)); if (i == NULL) break; - /* First print the town name and the industry type name. */ - int64 args_array[2] = {i->town->index, GetIndustrySpec(i->type)->name}; - StringParameters tmp_params(args_array); + 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 */ + StringParameters tmp_params(NULL, 0, NULL); + buff = FormatString(buff, GetStringPtr(GetIndustrySpec(i->type)->name), &tmp_params, last, next_substr_case_index); + } else { + /* First print the town name and the industry type name. */ + int64 args_array[2] = {i->town->index, GetIndustrySpec(i->type)->name}; + StringParameters tmp_params(args_array); - buff = FormatString(buff, GetStringPtr(STR_FORMAT_INDUSTRY_NAME), &tmp_params, last, next_substr_case_index); + buff = FormatString(buff, GetStringPtr(STR_FORMAT_INDUSTRY_NAME), &tmp_params, last, next_substr_case_index); + } next_substr_case_index = 0; break; } |