Use StringBuilder for GetString/GetStringWithArgs, as per upstream

Update dependent code as required
This commit is contained in:
Jonathan G Rennison
2024-01-05 21:12:54 +00:00
parent 1b7a5372ec
commit f034714559
61 changed files with 1064 additions and 1228 deletions

View File

@@ -787,20 +787,20 @@ std::string GenerateAutoNameForVehicleGroup(const Vehicle *v)
CargoTypes cargoes = GetVehicleCargoList(v);
char group_name[512];
StringID str;
if (town_from == town_to || town_to == nullptr) {
SetDParam(0, town_from->index);
SetDParam(1, (cargoes != 0) ? STR_VEHICLE_AUTO_GROUP_CARGO_LIST : STR_EMPTY);
SetDParam(2, cargoes);
GetString(group_name, STR_VEHICLE_AUTO_GROUP_LOCAL_ROUTE, lastof(group_name));
str = STR_VEHICLE_AUTO_GROUP_LOCAL_ROUTE;
} else {
SetDParam(0, town_from->index);
SetDParam(1, town_to->index);
SetDParam(2, (cargoes != 0) ? STR_VEHICLE_AUTO_GROUP_CARGO_LIST : STR_EMPTY);
SetDParam(3, cargoes);
GetString(group_name, STR_VEHICLE_AUTO_GROUP_ROUTE, lastof(group_name));
str = STR_VEHICLE_AUTO_GROUP_ROUTE;
}
return std::string(group_name);
return GetString(str);
}
/**