diff options
author | rubidium <rubidium@openttd.org> | 2009-03-09 21:55:17 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-03-09 21:55:17 +0000 |
commit | b743e49bf40d0257cbee95e8545b8505538257aa (patch) | |
tree | 241244fd8246bea9c7143aaba362ea886dd980b0 | |
parent | 4cc20fe0ae4ae56376c74fbc992ce0c3a143e72c (diff) | |
download | openttd-b743e49bf40d0257cbee95e8545b8505538257aa.tar.xz |
(svn r15657) -Fix [FS#2716]: undeterministic file sorting when the date is equal for all files
-rw-r--r-- | src/fios.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fios.cpp b/src/fios.cpp index 9d5db867a..7a0573acb 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -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; } |