Removed hardcoded maximum number of players.
This commit is contained in:
parent
60bbfe3ab3
commit
7e202d94a8
@ -49,7 +49,6 @@ ClientLobbyRoomProtocol::~ClientLobbyRoomProtocol()
|
||||
void ClientLobbyRoomProtocol::setup()
|
||||
{
|
||||
m_setup = STKHost::get()->setupNewGame(); // create a new setup
|
||||
m_setup->getRaceConfig()->setPlayerCount(16); //FIXME : this has to be changed when logging into the server
|
||||
m_state = NONE;
|
||||
} // setup
|
||||
|
||||
|
@ -204,12 +204,13 @@ RaceConfig::RaceConfig()
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void RaceConfig::setPlayerCount(uint8_t count)
|
||||
/** Sets the maximum number of players.
|
||||
*/
|
||||
void RaceConfig::setMaxPlayerCount(uint8_t count)
|
||||
{
|
||||
m_max_players = count;
|
||||
m_votes.resize(m_max_players);
|
||||
}
|
||||
} // setMaxPlayerCount
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
@ -86,7 +86,7 @@ class RaceConfig
|
||||
public:
|
||||
RaceConfig();
|
||||
|
||||
void setPlayerCount(uint8_t count);
|
||||
void setMaxPlayerCount(uint8_t count);
|
||||
void setPlayerMajorVote(uint8_t player_id, uint8_t major);
|
||||
void setPlayerRaceCountVote(uint8_t player_id, uint8_t count);
|
||||
void setPlayerMinorVote(uint8_t player_id, uint8_t minor);
|
||||
|
@ -132,6 +132,7 @@ GameSetup* STKHost::setupNewGame()
|
||||
if (m_game_setup)
|
||||
delete m_game_setup;
|
||||
m_game_setup = new GameSetup();
|
||||
m_game_setup->getRaceConfig()->setMaxPlayerCount(m_max_players);
|
||||
return m_game_setup;
|
||||
} // setupNewGame
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user