always sort game descriptions by displayed name

git-svn-id: svn://svn.icculus.org/netradiant/trunk@357 61c419a2-8eb2-4b30-bcec-8cead039b335
This commit is contained in:
divverent 2009-04-29 16:35:28 +00:00
parent 64bbc7deef
commit a1f2938c75

View File

@ -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<CGameDescription *>::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;