From b2306505ace8677c730acdd7e968befd00fd949c Mon Sep 17 00:00:00 2001 From: mb Date: Thu, 9 Apr 2026 11:23:26 +0200 Subject: [PATCH] Cleanup loop for arrowItems without targetItem on drawArrow --- cockatrice/src/game/board/card_item.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cockatrice/src/game/board/card_item.cpp b/cockatrice/src/game/board/card_item.cpp index cf3c7db20..cd37b9066 100644 --- a/cockatrice/src/game/board/card_item.cpp +++ b/cockatrice/src/game/board/card_item.cpp @@ -285,6 +285,12 @@ void CardItem::drawArrow(const QColor &arrowColor) int currentPhase = game->getGameState()->getCurrentPhase(); phase = Phases::getLastSubphase(currentPhase) + 1; } + for (ArrowItem *arrowItem : getArrowsFrom()) { + if (arrowItem->getTargetItem() == nullptr) { + arrowItem->ungrabMouse(); + arrowItem->delArrow(); + } + } ArrowDragItem *arrow = new ArrowDragItem(arrowOwner, this, arrowColor, phase); scene()->addItem(arrow); arrow->grabMouse();