From 030e4f58712176b1d384fb45abf964eac2fe1855 Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Mon, 7 Sep 2026 13:37:13 +0200 Subject: [PATCH] [Game] Stop duplicate attach log entries (#7273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix duplicate attach messages in the game log caused by a redundant child arrow in CardItem::drawAttachArrow. Unlike the sibling drawArrow, drawAttachArrow omitted the ``card == this`` guard when iterating selectedItems(). Because right-clicking a card to open the attach menu selects that card, it was always present in selectedItems(), producing a second arrow for the same source card. On release both arrows sent an identical Command_AttachCard, so the server broadcast two Event_AttachCard messages and the log rendered "attaches to" twice. Mirror the drawArrow skip condition so the active card is excluded and only one attach command is sent. Co-authored-by: Lukas BrĂ¼bach --- cockatrice/src/game_graphics/board/card_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/game_graphics/board/card_item.cpp b/cockatrice/src/game_graphics/board/card_item.cpp index c40c8c214..c2dc455cc 100644 --- a/cockatrice/src/game_graphics/board/card_item.cpp +++ b/cockatrice/src/game_graphics/board/card_item.cpp @@ -316,7 +316,7 @@ void CardItem::drawAttachArrow() for (const auto &item : scene()->selectedItems()) { CardItem *card = qgraphicsitem_cast(item); - if (card == nullptr) { + if (card == nullptr || card == this) { continue; } if (card->getZone() != state->getZone()) {