diff --git a/src/states_screens/online_user_search.cpp b/src/states_screens/online_user_search.cpp index 43e5f1b27..6fc6fbeae 100644 --- a/src/states_screens/online_user_search.cpp +++ b/src/states_screens/online_user_search.cpp @@ -38,7 +38,6 @@ DEFINE_SCREEN_SINGLETON( OnlineUserSearch ); OnlineUserSearch::OnlineUserSearch() : Screen("online/user_search.stkgui") { - m_selected_index = -1; m_search_request = NULL; m_search_string = ""; m_last_search_string = ""; @@ -226,9 +225,9 @@ void OnlineUserSearch::eventCallback(GUIEngine::Widget* widget, } else if (name == m_user_list_widget->m_properties[GUIEngine::PROP_ID]) { - m_selected_index = m_user_list_widget->getSelectionID(); - if (m_selected_index != -1) - new UserInfoDialog(m_users[m_selected_index]); + int selected_index = m_user_list_widget->getSelectionID(); + if (selected_index != -1) + new UserInfoDialog(m_users[selected_index]); } else if (name == m_search_button_widget->m_properties[GUIEngine::PROP_ID]) { diff --git a/src/states_screens/online_user_search.hpp b/src/states_screens/online_user_search.hpp index 3f9398740..6dd1c3d44 100644 --- a/src/states_screens/online_user_search.hpp +++ b/src/states_screens/online_user_search.hpp @@ -48,9 +48,6 @@ private: /** Pointer to the result list. */ GUIEngine::ListWidget * m_user_list_widget; - /** The currently selected index, used to re-select this item after - * addons_loading is being displayed. */ - int m_selected_index; /** Seach string entered in the search widget. */ irr::core::stringw m_search_string; /** Last search string, used to avoid doing the same search again. */ diff --git a/src/states_screens/server_selection.cpp b/src/states_screens/server_selection.cpp index 65bb321f4..6d8ee430a 100644 --- a/src/states_screens/server_selection.cpp +++ b/src/states_screens/server_selection.cpp @@ -36,9 +36,7 @@ DEFINE_SCREEN_SINGLETON( ServerSelection ); ServerSelection::ServerSelection() : Screen("online/server_selection.stkgui") { - m_selected_index = -1; m_refresh_request = NULL; - } // ServerSelection // ---------------------------------------------------------------------------- @@ -159,9 +157,9 @@ void ServerSelection::eventCallback( GUIEngine::Widget* widget, else if (name == m_server_list_widget->m_properties[GUIEngine::PROP_ID]) { - m_selected_index = m_server_list_widget->getSelectionID(); - uint32_t server_id = ServersManager::get()->getServerBySort(m_selected_index)->getServerId(); - uint32_t host_id = ServersManager::get()->getServerBySort(m_selected_index)->getHostId(); + int selected_index = m_server_list_widget->getSelectionID(); + uint32_t server_id = ServersManager::get()->getServerBySort(selected_index)->getServerId(); + uint32_t host_id = ServersManager::get()->getServerBySort(selected_index)->getHostId(); new ServerInfoDialog(server_id, host_id); } diff --git a/src/states_screens/server_selection.hpp b/src/states_screens/server_selection.hpp index 489b1cb80..4b5624b70 100644 --- a/src/states_screens/server_selection.hpp +++ b/src/states_screens/server_selection.hpp @@ -43,11 +43,6 @@ private: GUIEngine::LabelWidget * m_update_status; GUIEngine::ListWidget * m_server_list_widget; - - /** The currently selected index, used to re-select this item after - * addons_loading is being displayed. */ - int m_selected_index; - /** \brief To check (and set) if sort order is descending **/ bool m_sort_desc;