added random avatar fetching for game modes in which you don't fight a specific deck...

fixed a crash from random deck game modes where it was trying to check against a selected deck...but there is no selected deck in random.
(side effect of this is that i can not bypass this, the stat still need to be run through without causing choas so i set it to deckname "" and id 0...we *might* need to find a different id...though it didn't seem to effect deck 0 as the name does not match)
This commit is contained in:
omegablast2002@yahoo.com
2011-11-07 22:16:02 +00:00
parent 1ef9489ea0
commit 52db4b9ac4
2 changed files with 16 additions and 2 deletions

View File

@@ -185,8 +185,8 @@ StatsWrapper * DeckManager::getExtendedDeckStats( DeckMetaData *selectedDeck, MT
{
StatsWrapper* stats = NULL;
string deckName = selectedDeck->getFilename();
int deckId = selectedDeck->getDeckId();
string deckName = selectedDeck?selectedDeck->getFilename():"";
int deckId = selectedDeck?selectedDeck->getDeckId():0;
map<string, StatsWrapper*>* statsMap = isAI ? &aiDeckStatsMap : &playerDeckStatsMap;
if ( statsMap->find(deckName) == statsMap->end())