mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -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());
|
QString playerName = "@" + QString::fromStdString(prop.user_info().name());
|
||||||
emit addPlayerToAutoCompleteList(playerName);
|
emit addPlayerToAutoCompleteList(playerName);
|
||||||
if (prop.spectator()) {
|
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 {
|
} else {
|
||||||
Player *player = game->getPlayerManager()->getPlayers().value(playerId, 0);
|
Player *player = game->getPlayerManager()->getPlayers().value(playerId, 0);
|
||||||
if (!player) {
|
if (!player) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue