Commit ba34b60e authored by Max-Wilhelm Bruker's avatar Max-Wilhelm Bruker
Browse files

server crash fix

parent f2473be5
...@@ -594,7 +594,9 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player * ...@@ -594,7 +594,9 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player *
if (card->getParentCard()) if (card->getParentCard())
card->setParentCard(0); card->setParentCard(0);
const QList<Server_Card *> &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<Server_Card *> attachedCards = card->getAttachedCards();
for (int i = 0; i < attachedCards.size(); ++i) for (int i = 0; i < attachedCards.size(); ++i)
unattachCard(game, attachedCards[i]->getZone()->getPlayer(), cont, attachedCards[i]); unattachCard(game, attachedCards[i]->getZone()->getPlayer(), cont, attachedCards[i]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment