mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[TabGame/GameEventHandler] Re-emit spectator addition signals in eventGameStateChanged (#6187)
* [TabGame/GameEventHandler] Re-emit spectator addition signals in eventGameStateChanged. Took 36 minutes * Check spectators as a whole. Took 2 minutes * Lint. Took 42 seconds --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
f2ce5e9693
commit
5381562a5e
1 changed files with 5 additions and 1 deletions
|
|
@ -251,7 +251,11 @@ void GameEventHandler::eventGameStateChanged(const Event_GameStateChanged &event
|
|||
QString playerName = "@" + QString::fromStdString(prop.user_info().name());
|
||||
emit addPlayerToAutoCompleteList(playerName);
|
||||
if (prop.spectator()) {
|
||||
game->getPlayerManager()->addSpectator(playerId, prop);
|
||||
if (!game->getPlayerManager()->getSpectators().contains(playerId)) {
|
||||
game->getPlayerManager()->addSpectator(playerId, prop);
|
||||
emit spectatorJoined(prop);
|
||||
emit logJoinSpectator(playerName);
|
||||
}
|
||||
} else {
|
||||
Player *player = game->getPlayerManager()->getPlayers().value(playerId, 0);
|
||||
if (!player) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue