Fix #11108, e2f583a: missing argument for SCC_CARGO_SHORT formatting

(cherry picked from commit 968de827d6)
This commit is contained in:
Rubidium 2023-07-06 18:50:27 +02:00 committed by Jonathan G Rennison
parent 7ffc9c9339
commit da21772f2d

View File

@ -1435,17 +1435,19 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
switch (cargo_str) { switch (cargo_str) {
case STR_TONS: { case STR_TONS: {
assert(_settings_game.locale.units_weight < lengthof(_units_weight)); assert(_settings_game.locale.units_weight < lengthof(_units_weight));
int64 args_array[] = {_units_weight[_settings_game.locale.units_weight].c.ToDisplay(args->GetInt64())}; const auto &x = _units_weight[_settings_game.locale.units_weight];
int64 args_array[] = {x.c.ToDisplay(args->GetInt64()), x.decimal_places};
StringParameters tmp_params(args_array); StringParameters tmp_params(args_array);
buff = FormatString(buff, GetStringPtr(_units_weight[_settings_game.locale.units_weight].l), &tmp_params, last); buff = FormatString(buff, GetStringPtr(x.l), &tmp_params, last);
break; break;
} }
case STR_LITERS: { case STR_LITERS: {
assert(_settings_game.locale.units_volume < lengthof(_units_volume)); assert(_settings_game.locale.units_volume < lengthof(_units_volume));
int64 args_array[] = {_units_volume[_settings_game.locale.units_volume].c.ToDisplay(args->GetInt64())}; const auto &x = _units_volume[_settings_game.locale.units_volume];
int64 args_array[] = {x.c.ToDisplay(args->GetInt64()), x.decimal_places};
StringParameters tmp_params(args_array); StringParameters tmp_params(args_array);
buff = FormatString(buff, GetStringPtr(_units_volume[_settings_game.locale.units_volume].l), &tmp_params, last); buff = FormatString(buff, GetStringPtr(x.l), &tmp_params, last);
break; break;
} }