From dac14020a28bae5b7f016228d1271993878db467 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Sun, 27 Jan 2013 18:52:12 +0000 Subject: [PATCH] fixed stats resetting and decks being marked as new. this should also allow for the ai difficulty tools to work correctly again. mana symbols displayed again, mini info, and everything related to the stats. --- projects/mtg/src/DeckStats.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/projects/mtg/src/DeckStats.cpp b/projects/mtg/src/DeckStats.cpp index 329ce3736..71fd9b24f 100644 --- a/projects/mtg/src/DeckStats.cpp +++ b/projects/mtg/src/DeckStats.cpp @@ -49,7 +49,20 @@ DeckStats::~DeckStats() DeckStat* DeckStats::getDeckStat(string opponentsFile) { map stats = masterDeckStats[currentDeck]; - map::iterator it = stats.find(opponentsFile); + //map::iterator it = stats.find(opponentsFile); + //this method can not find the opponentfile string + //stats string for first doesn't even act like a string, i was forced to pull it out of the + //iter to make the comparison. it->first.find( for example was not finding it even though i can + //see them in the debugger as matching strings + map::iterator it; + for (it = stats.begin(); it != stats.end(); ++it) + { + string deckStatName = it->first; + if(deckStatName.find(opponentsFile.c_str()) != string::npos) + { + break; + } + } if (it == stats.end()) { return NULL;