1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-26 05:34:12 +01:00

Codechange: Use GetString() with argument parameters in simple cases. (#13551)

Avoids using global string parameters.
This commit is contained in:
Peter Nelson
2025-02-14 00:10:56 +00:00
committed by GitHub
parent c3d5e6d2a0
commit 20e57a02a2
26 changed files with 79 additions and 170 deletions

View File

@@ -1450,14 +1450,12 @@ static bool VehicleNameSorter(const Vehicle * const &a, const Vehicle * const &b
if (a != _last_vehicle[0]) {
_last_vehicle[0] = a;
SetDParam(0, a->index);
last_name[0] = GetString(STR_VEHICLE_NAME);
last_name[0] = GetString(STR_VEHICLE_NAME, a->index);
}
if (b != _last_vehicle[1]) {
_last_vehicle[1] = b;
SetDParam(0, b->index);
last_name[1] = GetString(STR_VEHICLE_NAME);
last_name[1] = GetString(STR_VEHICLE_NAME, b->index);
}
int r = StrNaturalCompare(last_name[0], last_name[1]); // Sort by name (natural sorting).