mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 04:53:54 -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;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player->getLogic()->getGame()->getActiveCard()) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If is spectator (as spectators don't need card menus), return
|
// If is spectator (as spectators don't need card menus), return
|
||||||
// only update the menu if the card is actually selected
|
// only update the menu if the card is actually selected
|
||||||
|
auto *activeCard = player->getLogic()->getGame()->getActiveCard();
|
||||||
if ((player->getLogic()->getGame()->getPlayerManager()->isSpectator() &&
|
if ((player->getLogic()->getGame()->getPlayerManager()->isSpectator() &&
|
||||||
!player->getLogic()->getGame()->getPlayerManager()->isJudge()) ||
|
!player->getLogic()->getGame()->getPlayerManager()->isJudge()) ||
|
||||||
player->getLogic()->getGame()->getActiveCard()->getState() != card) {
|
!activeCard || activeCard->getState() != card) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue