mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-17 07:22:01 -08:00
attach bug fix
This commit is contained in:
@@ -774,14 +774,19 @@ void Player::eventAttachCard(Event_AttachCard *event)
|
||||
if (!startCard)
|
||||
return;
|
||||
|
||||
CardItem *oldParent = startCard->getAttachedTo();
|
||||
|
||||
if (targetZone)
|
||||
startCard->setParentItem(targetZone);
|
||||
else
|
||||
startCard->setParentItem(startZone);
|
||||
startCard->setAttachedTo(targetCard);
|
||||
|
||||
startZone->reorganizeCards();
|
||||
if ((startZone != targetZone) && targetZone)
|
||||
targetZone->reorganizeCards();
|
||||
if (oldParent)
|
||||
oldParent->getZone()->reorganizeCards();
|
||||
|
||||
if (targetCard)
|
||||
emit logAttachCard(this, startCard->getName(), targetPlayer, targetCard->getName());
|
||||
|
||||
Reference in New Issue
Block a user