mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 20:34:41 +00:00
(svn r15611) -Change: when sorting files on modification date and the modification date is equal sort on the title so reversing the sorting direction actually reverses the order the listed files
This commit is contained in:
parent
0d8da02ec1
commit
6cbf131318
@ -49,14 +49,14 @@ int CDECL compare_FiosItems(const void *a, const void *b)
|
||||
{
|
||||
const FiosItem *da = (const FiosItem *)a;
|
||||
const FiosItem *db = (const FiosItem *)b;
|
||||
int r;
|
||||
int r = 0;
|
||||
|
||||
if (_savegame_sort_order & SORT_BY_NAME) {
|
||||
r = strcasecmp(da->title, db->title);
|
||||
} else {
|
||||
if ((_savegame_sort_order & SORT_BY_NAME) == 0) {
|
||||
r = da->mtime < db->mtime ? -1 : 1;
|
||||
}
|
||||
|
||||
if (r == 0) r = strcasecmp(da->title, db->title);
|
||||
|
||||
if (_savegame_sort_order & SORT_DESCENDING) r = -r;
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user