"git@gitlab.completext.com:quzar/Cockatrice.git" did not exist on "438aacb9c45061f87435a3a0b93d75c817366729"
Commit 6fb16545 authored by Max-Wilhelm Bruker's avatar Max-Wilhelm Bruker
Browse files

Fixed server crash when unattaching card

parent d7b3764b
......@@ -670,11 +670,14 @@ ResponseCode Server_ProtocolHandler::cmdAttachCard(Command_AttachCard *cmd, Comm
return RespContextError;
if (targetPlayer)
targetzone = targetPlayer->getZones().value(cmd->getTargetZone());
if (targetzone)
if (targetzone) {
// 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 (!targetzone->hasCoords())
return RespContextError;
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())
}
if (!startzone->hasCoords())
return RespContextError;
// Get all arrows pointing to or originating from the card being attached and delete them.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment