From 48287363b24c093f685c88301b232e329108f9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sun, 28 Sep 2025 06:37:05 +0200 Subject: [PATCH] Check spectators as a whole. Took 2 minutes --- cockatrice/src/game/game_event_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/game/game_event_handler.cpp b/cockatrice/src/game/game_event_handler.cpp index 4b0247e27..9fed02a16 100644 --- a/cockatrice/src/game/game_event_handler.cpp +++ b/cockatrice/src/game/game_event_handler.cpp @@ -251,7 +251,7 @@ void GameEventHandler::eventGameStateChanged(const Event_GameStateChanged &event QString playerName = "@" + QString::fromStdString(prop.user_info().name()); emit addPlayerToAutoCompleteList(playerName); if (prop.spectator()) { - if (game->getPlayerManager()->getSpectator(playerId).id() == -1) { + if (!game->getPlayerManager()->getSpectators().contains(playerId)){ game->getPlayerManager()->addSpectator(playerId, prop); emit spectatorJoined(prop); emit logJoinSpectator(playerName);