Fix spectator if network splitscreen is enabled
This commit is contained in:
@@ -278,7 +278,8 @@ void ClientLobby::addAllPlayers(Event* event)
|
||||
uint16_t flag_return_timeout = data.getUInt16();
|
||||
race_manager->setFlagReturnTicks(flag_return_timeout);
|
||||
}
|
||||
configRemoteKart(players);
|
||||
configRemoteKart(players, isSpectator() ? 1 :
|
||||
(int)NetworkConfig::get()->getNetworkPlayers().size());
|
||||
loadWorld();
|
||||
// Disable until render gui during loading is bug free
|
||||
//StateManager::get()->enterGameState();
|
||||
|
||||
@@ -91,14 +91,14 @@ void LobbyProtocol::loadWorld()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void LobbyProtocol::configRemoteKart(
|
||||
const std::vector<std::shared_ptr<NetworkPlayerProfile> >& players) const
|
||||
const std::vector<std::shared_ptr<NetworkPlayerProfile> >& players,
|
||||
int local_player_size) const
|
||||
{
|
||||
// The number of karts includes the AI karts, which are not supported atm
|
||||
race_manager->setNumKarts((int)players.size());
|
||||
|
||||
// Set number of global and local players.
|
||||
race_manager->setNumPlayers((int)players.size(),
|
||||
(int)NetworkConfig::get()->getNetworkPlayers().size());
|
||||
race_manager->setNumPlayers((int)players.size(), local_player_size);
|
||||
|
||||
// Create the kart information for the race manager:
|
||||
// -------------------------------------------------
|
||||
|
||||
@@ -129,7 +129,8 @@ protected:
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
void configRemoteKart(
|
||||
const std::vector<std::shared_ptr<NetworkPlayerProfile> >& players) const;
|
||||
const std::vector<std::shared_ptr<NetworkPlayerProfile> >& players,
|
||||
int local_player_size) const;
|
||||
// ------------------------------------------------------------------------
|
||||
void joinStartGameThread()
|
||||
{
|
||||
|
||||
@@ -603,7 +603,7 @@ void ServerLobby::asynchronousUpdate()
|
||||
uint16_t flag_return_time = (uint16_t)stk_config->time2Ticks(
|
||||
ServerConfig::m_flag_return_timemout);
|
||||
race_manager->setFlagReturnTicks(flag_return_time);
|
||||
configRemoteKart(players);
|
||||
configRemoteKart(players, 0);
|
||||
|
||||
// Reset for next state usage
|
||||
resetPeersReady();
|
||||
|
||||
Reference in New Issue
Block a user