diff options
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index 010298062..8512a99c4 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -862,11 +862,24 @@ static char* FormatString(char* buff, const char* str, const int64* argv, uint c if (st->name != NULL) { buff = strecpy(buff, st->name, last); } else { + StringID str = st->string_id; + if (st->indtype != IT_INVALID) { + /* Special case where the industry provides the name for the station */ + const IndustrySpec *indsp = GetIndustrySpec(st->indtype); + + /* Industry GRFs can change which might remove the station name and + * thus cause very strange things. Here we check for that before we + * actually set the station name. */ + if (indsp->station_name != STR_NULL && indsp->station_name != STR_UNDEFINED) { + str = indsp->station_name; + } + } + int64 temp[3]; temp[0] = STR_TOWN; temp[1] = st->town->index; temp[2] = st->index; - buff = GetStringWithArgs(buff, st->string_id, temp, last); + buff = GetStringWithArgs(buff, str, temp, last); } break; } |