From 84adedb3f7c351fc9c4f50828c73640530b706d9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Dec 2009 04:32:22 +0200 Subject: Fix double servers list in ServerDialog --- src/gui/serverdialog.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gui/serverdialog.cpp') diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 32e714c6..bbbf132d 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -108,6 +108,7 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): currentConfig = "MostUsedServerPort" + toString(i); currentServer.port = (short) config.getValue(currentConfig, DEFAULT_PORT); + currentServer.type = ServerInfo::getCurrentType(); if (!currentServer.hostname.empty() && currentServer.port != 0) { @@ -207,6 +208,7 @@ void ServerDialog::action(const gcn::ActionEvent &event) ServerInfo tempServer; currentServer.hostname = mServerNameField->getText(); currentServer.port = (short) atoi(mPortField->getText().c_str()); + currentServer.type = ServerInfo::getCurrentType(); // now rewrite the configuration... // id = 0 is always the last selected server @@ -384,11 +386,11 @@ void ServerDialog::loadServers() { if (xmlStrEqual(subnode->name, BAD_CAST "connection")) { - if (compareStrI(type, "manaserv")) + if (!compareStrI(type, "manaserv")) { currentServer.type = ServerInfo::MANASERV; } - else if (compareStrI(type, "eathena")) + else if (!compareStrI(type, "eathena")) { currentServer.type = ServerInfo::EATHENA; } -- cgit v1.2.3-70-g09d2