mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 15:49:28 -08:00
do not allow other players to know which cards are in a player's hand (#6125)
This commit is contained in:
@@ -375,20 +375,17 @@ Response::ResponseCode Server_AbstractPlayer::moveCard(GameEventStorage &ges,
|
|||||||
|
|
||||||
eventPrivate.set_x(newX);
|
eventPrivate.set_x(newX);
|
||||||
|
|
||||||
// Other players do not get to see the start and/or target position of the card if the respective
|
if (
|
||||||
// part of the zone is being looked at. The information is not needed anyway because in hidden zones,
|
// cards from public zones have their id known, their previous position is already known, the event does
|
||||||
// all cards are equal.
|
// not accomodate for previous locations in zones with coordinates (which are always public)
|
||||||
if (((startzone->getType() == ServerInfo_Zone::HiddenZone) &&
|
(startzone->getType() != ServerInfo_Zone::PublicZone) &&
|
||||||
((startzone->getCardsBeingLookedAt() > position) || (startzone->getCardsBeingLookedAt() == -1))) ||
|
// other players are not allowed to be able to track which card is which in private zones like the hand
|
||||||
(startzone->getType() == ServerInfo_Zone::PublicZone)) {
|
(startzone->getType() != ServerInfo_Zone::PrivateZone)) {
|
||||||
eventOthers.set_position(-1);
|
|
||||||
} else {
|
|
||||||
eventOthers.set_position(position);
|
eventOthers.set_position(position);
|
||||||
}
|
}
|
||||||
if ((targetzone->getType() == ServerInfo_Zone::HiddenZone) &&
|
if (
|
||||||
((targetzone->getCardsBeingLookedAt() > newX) || (targetzone->getCardsBeingLookedAt() == -1))) {
|
// other players are not allowed to be able to track which card is which in private zones like the hand
|
||||||
eventOthers.set_x(-1);
|
(targetzone->getType() != ServerInfo_Zone::PrivateZone)) {
|
||||||
} else {
|
|
||||||
eventOthers.set_x(newX);
|
eventOthers.set_x(newX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user