Mercurial > hg > openttd
changeset 11308:4228af157233 draft
(svn r15657) -Fix [FS#2716]: undeterministic file sorting when the date is equal for all files
author | rubidium <rubidium@openttd.org> |
---|---|
date | Mon, 09 Mar 2009 21:55:17 +0000 |
parents | f988a4710742 |
children | ad76c686c7e3 |
files | src/fios.cpp |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fios.cpp +++ b/src/fios.cpp @@ -51,12 +51,12 @@ 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; }