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,10 +185,14 @@ void CardItem::setAttachedTo(CardItem *_attachedTo)
|
||||||
gridPoint.setX(-1);
|
gridPoint.setX(-1);
|
||||||
attachedTo = _attachedTo;
|
attachedTo = _attachedTo;
|
||||||
if (attachedTo != nullptr) {
|
if (attachedTo != nullptr) {
|
||||||
emit attachedTo->zone->cardAdded(this);
|
if (attachedTo->zone == nullptr) {
|
||||||
attachedTo->addAttachedCard(this);
|
deleteLater();
|
||||||
if (zone != attachedTo->getZone()) {
|
} else {
|
||||||
attachedTo->getZone()->reorganizeCards();
|
emit attachedTo->zone->cardAdded(this);
|
||||||
|
attachedTo->addAttachedCard(this);
|
||||||
|
if (zone != attachedTo->getZone()) {
|
||||||
|
attachedTo->getZone()->reorganizeCards();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If the zone is being torn down, it might already be null by the time a card tries to re-attach all its
|
// If the zone is being torn down, it might already be null by the time a card tries to re-attach all its
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue