diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/client/serverbrowser.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/engine/client/serverbrowser.cpp b/src/engine/client/serverbrowser.cpp index d60c15b8..87964003 100644 --- a/src/engine/client/serverbrowser.cpp +++ b/src/engine/client/serverbrowser.cpp @@ -26,7 +26,7 @@ class SortWrap CServerBrowser *m_pThis; public: SortWrap(CServerBrowser *t, SortFunc f) : m_pfnSort(f), m_pThis(t) {} - bool operator()(int a, int b) { return (m_pThis->*m_pfnSort)(a, b); } + bool operator()(int a, int b) { return (g_Config.m_BrSortOrder ? (m_pThis->*m_pfnSort)(b, a) : (m_pThis->*m_pfnSort)(a, b)); } }; CServerBrowser::CServerBrowser() @@ -294,17 +294,6 @@ void CServerBrowser::Sort() else if(g_Config.m_BrSort == IServerBrowser::SORT_GAMETYPE) std::stable_sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this, &CServerBrowser::SortCompareGametype)); - // invert the list if requested - if(g_Config.m_BrSortOrder) - { - for(i = 0; i < m_NumSortedServers/2; i++) - { - int Temp = m_pSortedServerlist[i]; - m_pSortedServerlist[i] = m_pSortedServerlist[m_NumSortedServers-i-1]; - m_pSortedServerlist[m_NumSortedServers-i-1] = Temp; - } - } - // set indexes for(i = 0; i < m_NumSortedServers; i++) m_ppServerlist[m_pSortedServerlist[i]]->m_Info.m_SortedIndex = i; |