mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[Game] Stop duplicate attach log entries
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.
This commit is contained in:
parent
6e5c58069b
commit
ae117ecfc0
1 changed files with 1 additions and 1 deletions
|
|
@ -316,7 +316,7 @@ void CardItem::drawAttachArrow()
|
|||
|
||||
for (const auto &item : scene()->selectedItems()) {
|
||||
CardItem *card = qgraphicsitem_cast<CardItem *>(item);
|
||||
if (card == nullptr) {
|
||||
if (card == nullptr || card == this) {
|
||||
continue;
|
||||
}
|
||||
if (card->getZone() != state->getZone()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue