diff --git a/projects/mtg/src/MTGDeck.cpp b/projects/mtg/src/MTGDeck.cpp index 7359271b7..058c1d4c3 100644 --- a/projects/mtg/src/MTGDeck.cpp +++ b/projects/mtg/src/MTGDeck.cpp @@ -544,12 +544,14 @@ int MTGAllCards::countBySet(int setId) //TODO more efficient way ? int MTGAllCards::countByType(const string &_type) { + int type_id = findType(_type); + int result = 0; map::iterator it; for (it = collection.begin(); it != collection.end(); it++) { MTGCard * c = it->second; - if (c->data->hasType(_type)) + if (c->data->hasType(type_id)) { result++; }