From: Jürgen Doser Date: Tue, 22 Jan 2013 15:55:50 +0000 (+0100) Subject: Fix crash when pressing delete button in server browser and no server is selected. X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=f214940c96d9fef72b06a65641d01115a582b098;p=zefram%2Fminetest%2Fminetest_engine.git Fix crash when pressing delete button in server browser and no server is selected. A check for that was there, but was comparing an unsigned variable to -1, which doesn't work. --- diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 68ee990c..9291bb4e 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -1053,7 +1053,7 @@ bool GUIMainMenu::OnEvent(const SEvent& event) } case GUI_ID_SERVERLIST_DELETE: { gui::IGUIListBox *serverlist = (gui::IGUIListBox*)getElementFromId(GUI_ID_SERVERLIST); - u16 selected = ((gui::IGUIListBox*)serverlist)->getSelected(); + s32 selected = ((gui::IGUIListBox*)serverlist)->getSelected(); if (selected == -1) return true; ServerList::deleteEntry(m_data->servers[selected]); m_data->servers = ServerList::getLocal();