mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 19:18:55 -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)
|
if (!startCard)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CardItem *oldParent = startCard->getAttachedTo();
|
||||||
|
|
||||||
if (targetZone)
|
if (targetZone)
|
||||||
startCard->setParentItem(targetZone);
|
startCard->setParentItem(targetZone);
|
||||||
else
|
else
|
||||||
startCard->setParentItem(startZone);
|
startCard->setParentItem(startZone);
|
||||||
startCard->setAttachedTo(targetCard);
|
startCard->setAttachedTo(targetCard);
|
||||||
|
|
||||||
startZone->reorganizeCards();
|
startZone->reorganizeCards();
|
||||||
if ((startZone != targetZone) && targetZone)
|
if ((startZone != targetZone) && targetZone)
|
||||||
targetZone->reorganizeCards();
|
targetZone->reorganizeCards();
|
||||||
|
if (oldParent)
|
||||||
|
oldParent->getZone()->reorganizeCards();
|
||||||
|
|
||||||
if (targetCard)
|
if (targetCard)
|
||||||
emit logAttachCard(this, startCard->getName(), targetPlayer, targetCard->getName());
|
emit logAttachCard(this, startCard->getName(), targetPlayer, targetCard->getName());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue