Clear player chosen kart each race if not grand prix

This commit is contained in:
Benau 2018-09-13 00:40:55 +08:00
parent 114dca1733
commit e5aa172d00

View File

@ -130,12 +130,17 @@ ServerLobby::~ServerLobby()
void ServerLobby::setup()
{
LobbyProtocol::setup();
auto players = m_game_setup->getConnectedPlayers();
if (m_game_setup->isGrandPrix() && !m_game_setup->isGrandPrixStarted())
{
auto players = m_game_setup->getConnectedPlayers();
for (auto player : players)
player->resetGrandPrixData();
}
if (!m_game_setup->isGrandPrix() || !m_game_setup->isGrandPrixStarted())
{
for (auto player : players)
player->setKartName("");
}
StateManager::get()->resetActivePlayers();
// We use maximum 16bit unsigned limit