diff --git a/src/states_screens/online/networking_lobby.cpp b/src/states_screens/online/networking_lobby.cpp index fe90bf883..a25a52ee8 100644 --- a/src/states_screens/online/networking_lobby.cpp +++ b/src/states_screens/online/networking_lobby.cpp @@ -875,6 +875,16 @@ void NetworkingLobby::unloaded() // ---------------------------------------------------------------------------- void NetworkingLobby::tearDown() { + if (m_state == LS_ADD_PLAYERS) + { + UserConfigParams::m_enable_network_splitscreen = false; + NetworkConfig::get()->cleanNetworkPlayers(); + NetworkConfig::get()->addNetworkPlayer( + input_manager->getDeviceManager()->getLatestUsedDevice(), + PlayerManager::getCurrentPlayer(), HANDICAP_NONE); + NetworkConfig::get()->doneAddingNetworkPlayers(); + } + gui::IGUIStaticText* st = m_text_bubble->getIrrlichtElement(); st->setMouseCallback(nullptr); diff --git a/src/states_screens/online/online_screen.cpp b/src/states_screens/online/online_screen.cpp index 12cb2fcd7..308c8b2d3 100644 --- a/src/states_screens/online/online_screen.cpp +++ b/src/states_screens/online/online_screen.cpp @@ -68,7 +68,6 @@ void OnlineScreen::loadedFromFile() { m_enable_splitscreen = getWidget("enable-splitscreen"); assert(m_enable_splitscreen); - m_enable_splitscreen->setState(UserConfigParams::m_enable_network_splitscreen); } // loadedFromFile // ---------------------------------------------------------------------------- @@ -92,6 +91,8 @@ void OnlineScreen::init() RibbonWidget* r = getWidget("menu_toprow"); r->setFocusForPlayer(PLAYER_ID_GAME_MASTER); + m_enable_splitscreen->setState( + UserConfigParams::m_enable_network_splitscreen); // Pre-add a default single player profile in network if (!m_enable_splitscreen->getState() && NetworkConfig::get()->getNetworkPlayers().empty())