Skip to content

Commit

Permalink
Initially keep server list scrolled to the top
Browse files Browse the repository at this point in the history
When first launching the client, keep the server list scrolled to the top instead of scrolling to the selected server.

Closes ddnet#6845.
  • Loading branch information
Robyt3 committed Jul 15, 2023
1 parent cfdc696 commit 1532252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/client/components/menus_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)

int NumPlayers = 0;
static int s_PrevSelectedIndex = -1;
if(s_PrevSelectedIndex != m_SelectedIndex)
if(s_PrevSelectedIndex >= 0 && s_PrevSelectedIndex != m_SelectedIndex)
{
s_ListBox.ScrollToSelected();
s_PrevSelectedIndex = m_SelectedIndex;
Expand Down

0 comments on commit 1532252

Please sign in to comment.