From 40b947c1e7de238d5d693b0a99f2c10b3ecc895f Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Tue, 19 May 2026 12:26:17 +0200 Subject: [PATCH] fix cards attaching/transforming to the wrong card across players (#6909) * fix cards attaching/transforming to the wrong card across players * move comment --- cockatrice/src/game/player/player_actions.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/game/player/player_actions.cpp b/cockatrice/src/game/player/player_actions.cpp index c36cdaa1a..d5ba3b22b 100644 --- a/cockatrice/src/game/player/player_actions.cpp +++ b/cockatrice/src/game/player/player_actions.cpp @@ -1069,7 +1069,14 @@ bool PlayerActions::createRelatedFromRelation(const CardItem *sourceCard, const createCard(sourceCard, dbName, CardRelationType::DoesNotAttach, persistent); } } else { - auto attachType = cardRelation->getAttachType(); + CardRelationType attachType; + // do not attempt to attach to another player's cards, this causes the card to attempt to attach to the same + // cardid on the local player's field instead, which is an entirely different card! + if (player->getPlayerInfo()->getLocalOrJudge()) { + attachType = cardRelation->getAttachType(); + } else { + attachType = CardRelationType::DoesNotAttach; + } // move card onto table first if attaching from some other zone // we only do this for AttachTo because cross-zone TransformInto is already handled server-side