changeset 11262:de226219239a draft

(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
author rubidium <rubidium@openttd.org>
date Wed, 04 Mar 2009 10:02:00 +0000
parents 5a50ba45cf24
children fd811b569e21
files src/fios.cpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -49,14 +49,14 @@
 {
 	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;
 }