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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user