mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
attach bug fix
This commit is contained in:
parent
eff0c0cc24
commit
42e806c57f
1 changed files with 5 additions and 0 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue