Fix assert failure

This commit is contained in:
auria.mg 2018-03-02 19:46:43 -05:00
parent 402b2ffb7a
commit 0cd5b5672e

View File

@ -60,8 +60,12 @@ void CreateServerScreen::loadedFromFile()
m_max_players_widget = getWidget<SpinnerWidget>("max_players"); m_max_players_widget = getWidget<SpinnerWidget>("max_players");
assert(m_max_players_widget != NULL); assert(m_max_players_widget != NULL);
m_max_players_widget int max = UserConfigParams::m_server_max_players.getDefaultValue();
->setMax(UserConfigParams::m_server_max_players.getDefaultValue()); m_max_players_widget->setMax(max);
if (UserConfigParams::m_server_max_players > max)
UserConfigParams::m_server_max_players = max;
m_max_players_widget->setValue(UserConfigParams::m_server_max_players); m_max_players_widget->setValue(UserConfigParams::m_server_max_players);
m_info_widget = getWidget<LabelWidget>("info"); m_info_widget = getWidget<LabelWidget>("info");