diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp index 18c80565..8af18ccb 100644 --- a/common/server_protocolhandler.cpp +++ b/common/server_protocolhandler.cpp @@ -594,7 +594,9 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player * if (card->getParentCard()) card->setParentCard(0); - const QList &attachedCards = card->getAttachedCards(); + // DO NOT save a reference to the list, but make a real copy. + // The contents of the original list change during the loop. + const QList attachedCards = card->getAttachedCards(); for (int i = 0; i < attachedCards.size(); ++i) unattachCard(game, attachedCards[i]->getZone()->getPlayer(), cont, attachedCards[i]);