mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 00:12:15 -07:00
Also check for it in the successful branch.
Took 6 minutes
This commit is contained in:
parent
184901c19c
commit
df6143c03a
1 changed files with 8 additions and 4 deletions
|
|
@ -185,11 +185,15 @@ void CardItem::setAttachedTo(CardItem *_attachedTo)
|
|||
gridPoint.setX(-1);
|
||||
attachedTo = _attachedTo;
|
||||
if (attachedTo != nullptr) {
|
||||
if (attachedTo->zone == nullptr) {
|
||||
deleteLater();
|
||||
} else {
|
||||
emit attachedTo->zone->cardAdded(this);
|
||||
attachedTo->addAttachedCard(this);
|
||||
if (zone != attachedTo->getZone()) {
|
||||
attachedTo->getZone()->reorganizeCards();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If the zone is being torn down, it might already be null by the time a card tries to re-attach all its
|
||||
// attached cards
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue