From 341c48eb613a5ab05af497177e94076259c1d886 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Fri, 17 Sep 2010 11:25:33 +0000 Subject: [PATCH] Erwan - swapped StyleManager.h and .StyleManager.cpp files in VC++ project - attempt at fixing issue 451 (tokens in momir), please verify. Also attempt at fixing tokens in shop. --- projects/mtg/src/MTGDeck.cpp | 5 +++-- projects/mtg/src/MTGRules.cpp | 5 ++++- projects/mtg/template.vcproj | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/projects/mtg/src/MTGDeck.cpp b/projects/mtg/src/MTGDeck.cpp index ef872a6b8..f878fdf6b 100644 --- a/projects/mtg/src/MTGDeck.cpp +++ b/projects/mtg/src/MTGDeck.cpp @@ -610,8 +610,9 @@ int MTGDeck::addRandomCards(int howmany, int * setIds, int nbSets, int rarity, c for (int i = 0; i < collectionTotal; i++){ MTGCard * card = database->_(i); int r = card->getRarity(); - if (r != Constants::RARITY_T && (rarity == -1 || r==rarity) && - (!_subtype || card->data->hasSubtype(subtype)) + if (r != Constants::RARITY_T && (rarity == -1 || r==rarity) && // remove tokens + card->setId != -1 && //remove cards that are defined in primitives. Those are workarounds (usually tokens) and should only be used internally + (!_subtype || card->data->hasSubtype(subtype)) ){ int ok = 0; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 4a9343ac4..53590b3fd 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -827,7 +827,10 @@ MTGMomirRule::MTGMomirRule(int _id, MTGAllCards * _collection):MTGAbility(_id, N if (!initialized){ for (size_t i = 0; i < collection->ids.size(); i++){ MTGCard * card = collection->collection[collection->ids[i]]; - if (card->data->isCreature()){ + if (card->data->isCreature() && + (card->getRarity() != Constants::RARITY_T) && //remove tokens + card->setId != -1 //remove cards that are defined in primitives. Those are workarounds (usually tokens) and should only be used internally + ){ int convertedCost = card->data->getManaCost()->getConvertedCost(); if (convertedCost>20) continue; pool[convertedCost].push_back(card->getMTGId()); diff --git a/projects/mtg/template.vcproj b/projects/mtg/template.vcproj index 12f577b10..162c15f61 100644 --- a/projects/mtg/template.vcproj +++ b/projects/mtg/template.vcproj @@ -774,7 +774,7 @@ >