fix for issue 769, random modes including momir do not have meta data.
This commit is contained in:
@@ -180,7 +180,7 @@ void DeckStats::save(const std::string& filename)
|
|||||||
string playerDeckFilePath= options.profileFile( buffer);
|
string playerDeckFilePath= options.profileFile( buffer);
|
||||||
DeckManager *deckManager = DeckManager::GetInstance();
|
DeckManager *deckManager = DeckManager::GetInstance();
|
||||||
DeckMetaData *playerDeckMeta = deckManager->getDeckMetaDataByFilename(playerDeckFilePath, false);
|
DeckMetaData *playerDeckMeta = deckManager->getDeckMetaDataByFilename(playerDeckFilePath, false);
|
||||||
if ( playerDeckMeta->getColorIndex() == "" )
|
if (playerDeckMeta && playerDeckMeta->getColorIndex() == "" )
|
||||||
{
|
{
|
||||||
StatsWrapper *stw = deckManager->getExtendedDeckStats( playerDeckMeta, MTGAllCards::getInstance(), false);
|
StatsWrapper *stw = deckManager->getExtendedDeckStats( playerDeckMeta, MTGAllCards::getInstance(), false);
|
||||||
manaColorIndex = stw->getManaColorIndex();
|
manaColorIndex = stw->getManaColorIndex();
|
||||||
@@ -198,8 +198,8 @@ void DeckStats::save(const std::string& filename)
|
|||||||
file << "MANA:" << it->second->manaColorIndex <<endl;
|
file << "MANA:" << it->second->manaColorIndex <<endl;
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
if(playerDeckMeta)
|
||||||
playerDeckMeta->Invalidate();
|
playerDeckMeta->Invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user