Skip to content

Commit

Permalink
gui2/mp_connect: Fix adding new servers under built-ins
Browse files Browse the repository at this point in the history
If the current selection was a built-in server, the new server would be
added right below it even if it wasn't the last built-in server,
resulting in a new entry that can't be deleted without closing the
dialog and launching it again to force the server list to be
re-enumerated correctly.
  • Loading branch information
irydacea committed Jan 26, 2020
1 parent 57ef823 commit 1104d37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/dialogs/multiplayer/mp_connect.cpp
Expand Up @@ -197,7 +197,7 @@ void mp_connect::on_server_add()

const std::size_t mem_pos = selection.user_defined() && !user_servers_.empty()
? 1 + selection.relative_index() : 0;
const unsigned int ui_pos = 1 + selection.row();
const unsigned int ui_pos = selection.user_defined() ? 1 + selection.row() : builtin_servers_.size();

std::string name;

Expand Down

0 comments on commit 1104d37

Please sign in to comment.