diff --git a/src/network/game_setup.hpp b/src/network/game_setup.hpp index 54ede216e..038e673fa 100644 --- a/src/network/game_setup.hpp +++ b/src/network/game_setup.hpp @@ -80,7 +80,7 @@ public: /** \brief Get the players that are in the game * \return A vector containing pointers on the players profiles. */ std::vector > - getConnectedPlayers() const + getConnectedPlayers(bool same_index_for_disconnected = false) const { std::lock_guard lock(m_players_mutex); std::vector > players; @@ -88,6 +88,8 @@ public: { if (auto player_connected = player_weak.lock()) players.push_back(player_connected); + else if (same_index_for_disconnected) + players.push_back(nullptr); } return players; } // getConnectedPlayers