mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-25 15:39:09 +00:00
(svn r15657) -Fix [FS#2716]: undeterministic file sorting when the date is equal for all files
This commit is contained in:
@@ -51,12 +51,12 @@ int CDECL compare_FiosItems(const void *a, const void *b)
|
||||
const FiosItem *db = (const FiosItem *)b;
|
||||
int r = 0;
|
||||
|
||||
if ((_savegame_sort_order & SORT_BY_NAME) == 0) {
|
||||
if ((_savegame_sort_order & SORT_BY_NAME) == 0 && da->mtime != db->mtime) {
|
||||
r = da->mtime < db->mtime ? -1 : 1;
|
||||
} else {
|
||||
r = strcasecmp(da->title, db->title);
|
||||
}
|
||||
|
||||
if (r == 0) r = strcasecmp(da->title, db->title);
|
||||
|
||||
if (_savegame_sort_order & SORT_DESCENDING) r = -r;
|
||||
return r;
|
||||
}
|
||||
|
Reference in New Issue
Block a user