@@ -1147,194 +1147,195 @@ static char *FormatString(char *buff, co
break;
case SCC_FORCE: { // {FORCE}
assert(_settings_game.locale.units < lengthof(_units));
int64 args_array[1] = {_units[_settings_game.locale.units].c_force.ToDisplay(args->GetInt64())};
StringParameters tmp_params(args_array);
buff = FormatString(buff, GetStringPtr(_units[_settings_game.locale.units].force), &tmp_params, last);
}
case SCC_HEIGHT: { // {HEIGHT}
int64 args_array[] = {_units[_settings_game.locale.units].c_height.ToDisplay(args->GetInt64())};
buff = FormatString(buff, GetStringPtr(_units[_settings_game.locale.units].height), &tmp_params, last);
case SCC_POWER: { // {POWER}
int64 args_array[1] = {_units[_settings_game.locale.units].c_power.ToDisplay(args->GetInt64())};
buff = FormatString(buff, GetStringPtr(_units[_settings_game.locale.units].power), &tmp_params, last);
case SCC_VELOCITY: { // {VELOCITY}
int64 args_array[] = {ConvertSpeedToDisplaySpeed(args->GetInt64(SCC_VELOCITY) * 10 / 16)};
buff = FormatString(buff, GetStringPtr(_units[_settings_game.locale.units].velocity), &tmp_params, last);
case SCC_VOLUME_SHORT: { // {VOLUME_SHORT}
int64 args_array[1] = {_units[_settings_game.locale.units].c_volume.ToDisplay(args->GetInt64())};
buff = FormatString(buff, GetStringPtr(_units[_settings_game.locale.units].s_volume), &tmp_params, last);
case SCC_VOLUME_LONG: { // {VOLUME_LONG}
int64 args_array[1] = {_units[_settings_game.locale.units].c_volume.ToDisplay(args->GetInt64(SCC_VOLUME_LONG))};
buff = FormatString(buff, GetStringPtr(_units[_settings_game.locale.units].l_volume), &tmp_params, last);
case SCC_WEIGHT_SHORT: { // {WEIGHT_SHORT}
int64 args_array[1] = {_units[_settings_game.locale.units].c_weight.ToDisplay(args->GetInt64())};
buff = FormatString(buff, GetStringPtr(_units[_settings_game.locale.units].s_weight), &tmp_params, last);
case SCC_WEIGHT_LONG: { // {WEIGHT_LONG}
int64 args_array[1] = {_units[_settings_game.locale.units].c_weight.ToDisplay(args->GetInt64(SCC_WEIGHT_LONG))};
buff = FormatString(buff, GetStringPtr(_units[_settings_game.locale.units].l_weight), &tmp_params, last);
case SCC_COMPANY_NAME: { // {COMPANY}
const Company *c = Company::GetIfValid(args->GetInt32());
if (c == NULL) break;
if (c->name != NULL) {
int64 args_array[] = {(uint64)(size_t)c->name};
buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
} else {
int64 args_array[] = {c->name_2};
buff = GetStringWithArgs(buff, c->name_1, &tmp_params, last);
case SCC_COMPANY_NUM: { // {COMPANY_NUM}
CompanyID company = (CompanyID)args->GetInt32();
/* Nothing is added for AI or inactive companies */
if (Company::IsValidHumanID(company)) {
int64 args_array[] = {company + 1};
buff = GetStringWithArgs(buff, STR_FORMAT_COMPANY_NUM, &tmp_params, last);
case SCC_DEPOT_NAME: { // {DEPOT}
VehicleType vt = (VehicleType)args->GetInt32(SCC_DEPOT_NAME);
if (vt == VEH_AIRCRAFT) {
int64 args_array[] = {args->GetInt32()};
uint64 args_array[] = {args->GetInt32()};
WChar types_array[] = {SCC_STATION_NAME};
StringParameters tmp_params(args_array, 1, types_array);
buff = GetStringWithArgs(buff, STR_FORMAT_DEPOT_NAME_AIRCRAFT, &tmp_params, last);
const Depot *d = Depot::Get(args->GetInt32());
if (d->name != NULL) {
int64 args_array[] = {(uint64)(size_t)d->name};
int64 args_array[] = {d->town->index, d->town_cn + 1};
buff = GetStringWithArgs(buff, STR_FORMAT_DEPOT_NAME_TRAIN + 2 * vt + (d->town_cn == 0 ? 0 : 1), &tmp_params, last);
case SCC_ENGINE_NAME: { // {ENGINE}
const Engine *e = Engine::GetIfValid(args->GetInt32(SCC_ENGINE_NAME));
if (e == NULL) break;
if (e->name != NULL && e->IsEnabled()) {
int64 args_array[] = {(uint64)(size_t)e->name};
StringParameters tmp_params(NULL, 0, NULL);
buff = GetStringWithArgs(buff, e->info.string_id, &tmp_params, last);
case SCC_GROUP_NAME: { // {GROUP}
const Group *g = Group::GetIfValid(args->GetInt32());
if (g == NULL) break;
if (g->name != NULL) {
int64 args_array[] = {(uint64)(size_t)g->name};
int64 args_array[] = {g->index};
buff = GetStringWithArgs(buff, STR_FORMAT_GROUP_NAME, &tmp_params, last);
case SCC_INDUSTRY_NAME: { // {INDUSTRY}
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};
buff = FormatString(buff, GetStringPtr(STR_FORMAT_INDUSTRY_NAME), &tmp_params, last, next_substr_case_index);
next_substr_case_index = 0;
case SCC_PRESIDENT_NAME: { // {PRESIDENT_NAME}
const Company *c = Company::GetIfValid(args->GetInt32(SCC_PRESIDENT_NAME));
if (c->president_name != NULL) {
int64 args_array[] = {(uint64)(size_t)c->president_name};
int64 args_array[] = {c->president_name_2};
buff = GetStringWithArgs(buff, c->president_name_1, &tmp_params, last);
case SCC_STATION_NAME: { // {STATION}
StationID sid = args->GetInt32(SCC_STATION_NAME);
const Station *st = Station::GetIfValid(sid);
if (st == NULL) {
/* The station doesn't exist anymore. The only place where we might
* be "drawing" an invalid station is in the case of cargo that is
* in transit. */
buff = GetStringWithArgs(buff, STR_UNKNOWN_STATION, &tmp_params, last);
if (st->name != NULL) {
int64 args_array[] = {(uint64)(size_t)st->name};
Status change: