From a1f2938c756ee50f781572031a383e737e51d95f Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 29 Apr 2009 16:35:28 +0000 Subject: [PATCH] always sort game descriptions by displayed name git-svn-id: svn://svn.icculus.org/netradiant/trunk@357 61c419a2-8eb2-4b30-bcec-8cead039b335 --- radiant/preferences.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 5302c375..a691d812 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -461,7 +461,21 @@ void CGameDialog::Init() ScanForGames(); if (mGames.empty()) { - Error("Didn't find any valid game file descriptions, aborting\n"); + Error("Didn't find any valid game file descriptions, aborting\n"); + } + else + { + std::list::iterator iGame, iPrevGame; + for(iGame=mGames.begin(), iPrevGame = mGames.end(); iGame!=mGames.end(); iPrevGame = iGame, ++iGame) + { + if(iPrevGame != mGames.end()) + if(strcmp((*iGame)->getRequiredKeyValue("name"), (*iPrevGame)->getRequiredKeyValue("name")) < 0) + { + CGameDescription *h = *iGame; + *iGame = *iPrevGame; + *iPrevGame = h; + } + } } CGameDescription* currentGameDescription = 0; -- 2.39.2