mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-19 15:25:39 +00:00
(svn r6760) -Codechange: Do a case insensitive sort of train engine names and just normally
check a boolean; no special magic needed
This commit is contained in:
parent
bc20a1539a
commit
c0d2598ce4
@ -144,14 +144,14 @@ static int CDECL TrainEngineNameSorter(const void *a, const void *b)
|
|||||||
GetString(_bufcache, GetCustomEngineName(vb));
|
GetString(_bufcache, GetCustomEngineName(vb));
|
||||||
}
|
}
|
||||||
|
|
||||||
r = strcmp(buf1, _bufcache); // sort by name
|
r = strcasecmp(buf1, _bufcache); // sort by name
|
||||||
|
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
/* Use EngineID to sort instead since we want consistent sorting */
|
/* Use EngineID to sort instead since we want consistent sorting */
|
||||||
return TrainEngineNumberSorter(a, b);
|
return TrainEngineNumberSorter(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (_internal_sort_order & 1) ? -r : r;
|
return _internal_sort_order ? -r : r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b)
|
static int CDECL TrainEngineRunningCostSorter(const void *a, const void *b)
|
||||||
|
Loading…
Reference in New Issue
Block a user