Fixed crash (when going back from track screen to kart screen).

This commit is contained in:
hiker 2016-01-15 16:25:02 +11:00
parent d3a7c75a62
commit b7870b2377

View File

@ -68,8 +68,6 @@ void NetworkKartSelectionScreen::init()
IconButtonWidget* back_button = getWidget<IconButtonWidget>("back"); IconButtonWidget* back_button = getWidget<IconButtonWidget>("back");
back_button->setImage("gui/main_quit.png"); back_button->setImage("gui/main_quit.png");
m_multiplayer = false;
// add a widget for each player except self (already exists): // add a widget for each player except self (already exists):
GameSetup* setup = STKHost::get()->getGameSetup(); GameSetup* setup = STKHost::get()->getGameSetup();
if (!setup) if (!setup)
@ -95,6 +93,7 @@ void NetworkKartSelectionScreen::init()
// FIXME: atm only adds the local master, split screen supports // FIXME: atm only adds the local master, split screen supports
// needs to be added // needs to be added
int player_id = game_setup->getLocalMasterID(); int player_id = game_setup->getLocalMasterID();
m_id_mapping.clear();
m_id_mapping.insert(m_id_mapping.begin(), player_id); m_id_mapping.insert(m_id_mapping.begin(), player_id);
const int amount = m_kart_widgets.size(); const int amount = m_kart_widgets.size();