mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Allow Judges to see all information, regardless of room settings (#5053)
This commit is contained in:
parent
e2ab8db958
commit
b7fbc12ac0
6 changed files with 42 additions and 23 deletions
|
|
@ -323,11 +323,15 @@ void Server_CardZone::getInfo(ServerInfo_Zone *info, Server_Player *playerWhosAs
|
|||
info->set_name(name.toStdString());
|
||||
info->set_type(type);
|
||||
info->set_with_coords(has_coords);
|
||||
info->set_card_count(cards.size());
|
||||
info->set_card_count(static_cast<int>(cards.size()));
|
||||
info->set_always_reveal_top_card(alwaysRevealTopCard);
|
||||
info->set_always_look_at_top_card(alwaysLookAtTopCard);
|
||||
if ((((playerWhosAsking == player) || omniscient) && (type != ServerInfo_Zone::HiddenZone)) ||
|
||||
((playerWhosAsking != player) && (type == ServerInfo_Zone::PublicZone))) {
|
||||
|
||||
const auto selfPlayerAsking = playerWhosAsking == player || omniscient;
|
||||
const auto zonesSelfCanSee = type != ServerInfo_Zone::HiddenZone;
|
||||
const auto otherPlayerAsking = playerWhosAsking != player;
|
||||
const auto zonesOthersCanSee = type == ServerInfo_Zone::PublicZone;
|
||||
if ((selfPlayerAsking && zonesSelfCanSee) || (otherPlayerAsking && zonesOthersCanSee)) {
|
||||
QListIterator<Server_Card *> cardIterator(cards);
|
||||
while (cardIterator.hasNext())
|
||||
cardIterator.next()->getInfo(info->add_card_list());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue