diff --git a/common/decklist.cpp b/common/decklist.cpp index 3c54449e2..478ffb282 100644 --- a/common/decklist.cpp +++ b/common/decklist.cpp @@ -727,7 +727,7 @@ void DeckList::updateDeckHash() { QStringList cardList; bool isValidDeckList = true; - static QSet hashZones, optionalZones; + QSet hashZones, optionalZones; hashZones << "main" << "side"; // Zones in deck to be included in hashing process optionalZones << "tokens"; // Optional zones in deck not included in hashing process @@ -737,17 +737,15 @@ void DeckList::updateDeckHash() InnerDecklistNode *node = dynamic_cast(root->at(i)); for (int j = 0; j < node->size(); j++) { - DecklistCardNode *card = dynamic_cast(node->at(j)); - for (int k = 0; k < card->getNumber(); ++k) + if (hashZones.contains(node->getName())) // Mainboard or Sideboard { - if (hashZones.contains(node->getName())) // Mainboard or Sideboard - { + DecklistCardNode *card = dynamic_cast(node->at(j)); + for (int k = 0; k < card->getNumber(); ++k) cardList.append((node->getName() == "side" ? "SB:" : "") + card->getName().toLower()); - } - else if (!optionalZones.contains(node->getName())) // Not a valid zone -> cheater? - { - isValidDeckList = false; // Deck is invalid - } + } + else if (!optionalZones.contains(node->getName())) // Not a valid zone -> cheater? + { + isValidDeckList = false; // Deck is invalid } } }