mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user