aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürgen Doser <jurgen.doser@gmail.com>2013-01-22 16:55:50 +0100
committerJürgen Doser <jurgen.doser@gmail.com>2013-01-22 19:05:46 +0100
commitf214940c96d9fef72b06a65641d01115a582b098 (patch)
treeda63f086d850f675c1365c4b35bcef8228ea4cad
parent26a0efae2359334eb418f91bf85c0eae9db45646 (diff)
downloadminetest-f214940c96d9fef72b06a65641d01115a582b098.tar.gz
minetest-f214940c96d9fef72b06a65641d01115a582b098.tar.bz2
minetest-f214940c96d9fef72b06a65641d01115a582b098.zip
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.
-rw-r--r--src/guiMainMenu.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp
index 68ee990cd..9291bb4ec 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();