Lobby cleanup.

Actually define these variables and revert to sorting by state for
gamelists by default (despite not having a column to sort for that).

This was SVN commit r17387.
This commit is contained in:
elexis
2015-12-06 11:42:30 +00:00
parent 987a7028bd
commit 66ec6dbf12
@@ -448,6 +448,7 @@ function updateGameList()
g_SelectedGameIP = g_GameList[gamesBox.selected].ip;
g_GameList = Engine.GetGameList().filter(game => !filterGame(game)).sort((a, b) => {
var sortA, sortB;
switch (g_GameListSortBy)
{
case 'name':
@@ -465,6 +466,10 @@ function updateGameList()
sortA = a.nbp * b.tnbp;
sortB = b.nbp * a.tnbp;
break;
default:
sortA = gameStatuses.indexOf(a.state);
sortB = gameStatuses.indexOf(b.state);
break;
}
if (sortA < sortB) return -g_GameListOrder;
if (sortA > sortB) return +g_GameListOrder;