|
@@ -1027,6 +1027,9 @@ static char *FormatString(char *buff, co
|
|
|
|
|
|
case SCC_REVISION: // {REV}
|
|
|
buff = strecpy(buff, _openttd_revision, last);
|
|
|
buff = strecpy(buff, " (", last);
|
|
|
buff = strecpy(buff, _openttd_build_date_short, last);
|
|
|
buff = strecpy(buff, ")", last);
|
|
|
break;
|
|
|
|
|
|
case SCC_RAW_STRING_POINTER: { // {RAW_STRING}
|
|
@@ -1430,23 +1433,39 @@ static char *FormatString(char *buff, co
|
|
|
StringParameters tmp_params(args_array);
|
|
|
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, 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);
|
|
|
bool station_name_from_industry_success = false;
|
|
|
|
|
|
/* 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;
|
|
|
StringID str = st->string_id;
|
|
|
if (st->indtype != IT_INVALID)
|
|
|
{
|
|
|
if (_settings_game.construction.name_stations_based_on_industries == 2)
|
|
|
{
|
|
|
int64 args_array[] = { st->town->index, GetIndustrySpec(st->indtype)->name };
|
|
|
StringParameters tmp_params(args_array);
|
|
|
buff = FormatString(buff, GetStringPtr(STR_FORMAT_INDUSTRY_NAME), &tmp_params, last);
|
|
|
station_name_from_industry_success = true;
|
|
|
}
|
|
|
else if (_settings_game.construction.name_stations_based_on_industries == 1)
|
|
|
{
|
|
|
/* 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;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
uint64 args_array[] = {STR_TOWN_NAME, st->town->index, st->index};
|
|
|
WChar types_array[] = {0, SCC_TOWN_NAME, SCC_NUM};
|
|
|
StringParameters tmp_params(args_array, 3, types_array);
|
|
|
buff = GetStringWithArgs(buff, str, &tmp_params, last);
|
|
|
|
|
|
if (!station_name_from_industry_success)
|
|
|
{
|
|
|
uint64 args_array[] = {STR_TOWN_NAME, st->town->index, st->index};
|
|
|
WChar types_array[] = {0, SCC_TOWN_NAME, SCC_NUM};
|
|
|
StringParameters tmp_params(args_array, 3, types_array);
|
|
|
buff = GetStringWithArgs(buff, str, &tmp_params, last);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|