mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Cleanup loop for arrowItems without targetItem on drawArrow
This commit is contained in:
parent
d7b31f2f9d
commit
b2306505ac
1 changed files with 6 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue