mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 19:18:55 -07:00
Guard differently.
Took 2 minutes
This commit is contained in:
parent
815baa1ffd
commit
160c43fad1
1 changed files with 2 additions and 5 deletions
|
|
@ -76,15 +76,12 @@ QMenu *PlayerMenu::updateCardMenu(const CardState *card)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (!player->getLogic()->getGame()->getActiveCard()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// If is spectator (as spectators don't need card menus), return
|
||||
// only update the menu if the card is actually selected
|
||||
auto *activeCard = player->getLogic()->getGame()->getActiveCard();
|
||||
if ((player->getLogic()->getGame()->getPlayerManager()->isSpectator() &&
|
||||
!player->getLogic()->getGame()->getPlayerManager()->isJudge()) ||
|
||||
player->getLogic()->getGame()->getActiveCard()->getState() != card) {
|
||||
!activeCard || activeCard->getState() != card) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue