diff --git a/src/network/game_setup.hpp b/src/network/game_setup.hpp index 7124cfe34..8f6d3dd31 100644 --- a/src/network/game_setup.hpp +++ b/src/network/game_setup.hpp @@ -24,8 +24,6 @@ #include "network/remote_kart_info.hpp" -#include -#include #include #include #include @@ -90,10 +88,11 @@ public: { std::lock_guard lock(m_players_mutex); std::vector > players; - std::transform(m_players.begin(), m_players.end(), - std::back_inserter(players), - std::bind(&std::weak_ptr::lock, - std::placeholders::_1)); + for (auto player_weak : m_players) + { + if (auto player_connected = player_weak.lock()) + players.push_back(player_connected); + } return players; } // getConnectedPlayers // ------------------------------------------------------------------------