From 161661b781df29a8a25b1838d3b68ec7a576155b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Mon, 15 Sep 2025 18:59:31 +0200 Subject: [PATCH] Comment. Took 5 minutes --- cockatrice/src/game/board/card_item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/game/board/card_item.cpp b/cockatrice/src/game/board/card_item.cpp index db15c8f03..e3b985f11 100644 --- a/cockatrice/src/game/board/card_item.cpp +++ b/cockatrice/src/game/board/card_item.cpp @@ -185,6 +185,8 @@ void CardItem::setAttachedTo(CardItem *_attachedTo) gridPoint.setX(-1); attachedTo = _attachedTo; if (attachedTo != nullptr) { + // If the zone is being torn down, it might already be null by the time a card tries to un-attach all its + // attached cards if (attachedTo->zone == nullptr) { deleteLater(); } else { @@ -195,7 +197,7 @@ void CardItem::setAttachedTo(CardItem *_attachedTo) } } } 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 un-attach all its // attached cards if (zone == nullptr) { deleteLater();