Remove or adjust more invalid vote settings

This commit is contained in:
Benau 2018-12-20 12:45:27 +08:00
parent d54a5028d2
commit 6342e04fea

View File

@ -1964,6 +1964,7 @@ void ServerLobby::handlePlayerVote(Event* event)
assert(t);
}
// Remove / adjust any invalid settings
if (race_manager->modeHasLaps())
{
if (ServerConfig::m_auto_game_time_ratio > 0.0f)
@ -1998,6 +1999,17 @@ void ServerLobby::handlePlayerVote(Event* event)
vote.m_num_laps = (uint8_t)7;
}
}
else if (race_manager->getMinorMode() ==
RaceManager::MINOR_MODE_FREE_FOR_ALL)
{
vote.m_num_laps = 0;
}
else if (race_manager->getMinorMode() ==
RaceManager::MINOR_MODE_CAPTURE_THE_FLAG)
{
vote.m_num_laps = 0;
vote.m_reverse = false;
}
// Store vote:
vote.m_player_name = event->getPeer()->getPlayerProfiles()[0]->getName();