Issue 634:
Fixed. Had to clear the DeckManager whenever the player deck selection screen is displayed. TODO: Need to implement a caching mechanism that caches the deck information based on deck selection and not a global one. Currently DeckManager is effectively treating the DeckMetaData as global data. *some minor tweaks to how deck information is managed/created
This commit is contained in:
@@ -56,7 +56,7 @@ void DeckMetaData::LoadStats()
|
||||
DeckStat * opponentDeckStats = stats->getDeckStat(mStatsFilename);
|
||||
if (opponentDeckStats)
|
||||
{
|
||||
mPercentVictories = stats->percentVictories(mStatsFilename);
|
||||
mPercentVictories = opponentDeckStats->percentVictories();
|
||||
mVictories = opponentDeckStats->victories;
|
||||
mGamesPlayed = opponentDeckStats->nbgames;
|
||||
mColorIndex = opponentDeckStats->manaColorIndex;
|
||||
@@ -73,6 +73,7 @@ void DeckMetaData::LoadStats()
|
||||
{
|
||||
mDifficulty = EASY;
|
||||
}
|
||||
mStatsLoaded = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -83,10 +84,10 @@ void DeckMetaData::LoadStats()
|
||||
mGamesPlayed = stats->nbGames();
|
||||
mPercentVictories = stats->percentVictories();
|
||||
mVictories = static_cast<int>(mGamesPlayed * (mPercentVictories / 100.0f));
|
||||
mStatsLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
mStatsLoaded = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user