Fix assertion failure at end of challenges

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12897 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2013-06-20 00:31:31 +00:00
parent df2430f26c
commit 1bbab17913
2 changed files with 5 additions and 3 deletions

View File

@ -57,7 +57,6 @@ public:
}; // UnlockableFeature
// ------------------------------------------------------------------------
private:
/** The various types of challenges that we support, which esp. determine
* when a challenge is tested if it is fulfilled. For now we have GP
* (a GP challenge, tested at the end of a GP), Race (tested at the
@ -74,6 +73,9 @@ private:
CM_ANY
};
private:
/** The challenge mode of this challenge. */
ChallengeModeType m_mode;

View File

@ -434,12 +434,12 @@ void UnlockManager::findWhatWasUnlocked(int points_before, int points_now,
if (c->getNumTrophies() > points_before &&
c->getNumTrophies() <= points_now )
{
if (c->getTrackId() != "")
if (c->getMode() == ChallengeData::CM_SINGLE_RACE && c->getTrackId() != "")
{
if (!getCurrentSlot()->isLocked(c->getTrackId()))
tracks.push_back(c->getTrackId());
}
else if (c->getGPId() != "")
else if (c->getMode() == ChallengeData::CM_GRAND_PRIX && c->getGPId() != "")
{
if (!getCurrentSlot()->isLocked(c->getGPId()))
gps.push_back(c->getGPId());