mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 12:33:55 -07:00
Disallow arrows pointing at or originating from cards in hidden/private zones. This fixes bug #0000024.
This commit is contained in:
parent
daf1fa18aa
commit
5ec06b4b27
1 changed files with 5 additions and 1 deletions
|
|
@ -672,6 +672,10 @@ ResponseCode Server_ProtocolHandler::cmdAttachCard(Command_AttachCard *cmd, Comm
|
||||||
targetzone = targetPlayer->getZones().value(cmd->getTargetZone());
|
targetzone = targetPlayer->getZones().value(cmd->getTargetZone());
|
||||||
if (targetzone)
|
if (targetzone)
|
||||||
targetCard = targetzone->getCard(cmd->getTargetCardId(), false);
|
targetCard = targetzone->getCard(cmd->getTargetCardId(), false);
|
||||||
|
// This is currently enough to make sure cards don't get attached to a card that is not on the table.
|
||||||
|
// Possibly a flag will have to be introduced for this sometime.
|
||||||
|
if (!startzone->hasCoords() || !targetzone->hasCoords())
|
||||||
|
return RespContextError;
|
||||||
|
|
||||||
// Get all arrows pointing to or originating from the card being attached and delete them.
|
// Get all arrows pointing to or originating from the card being attached and delete them.
|
||||||
QMapIterator<int, Server_Player *> playerIterator(game->getPlayers());
|
QMapIterator<int, Server_Player *> playerIterator(game->getPlayers());
|
||||||
|
|
@ -759,7 +763,7 @@ ResponseCode Server_ProtocolHandler::cmdCreateArrow(Command_CreateArrow *cmd, Co
|
||||||
Server_Card *targetCard = 0;
|
Server_Card *targetCard = 0;
|
||||||
if (!playerTarget)
|
if (!playerTarget)
|
||||||
targetCard = targetZone->getCard(cmd->getTargetCardId(), false);
|
targetCard = targetZone->getCard(cmd->getTargetCardId(), false);
|
||||||
if (!startCard || (!targetCard && !playerTarget) || (startCard == targetCard))
|
if (!startCard || (!targetCard && !playerTarget) || (startCard == targetCard) || (startZone->getType() != PublicZone) || (targetZone->getType() != PublicZone))
|
||||||
return RespContextError;
|
return RespContextError;
|
||||||
|
|
||||||
Server_ArrowTarget *targetItem;
|
Server_ArrowTarget *targetItem;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue