Don't announce fort magma as unlocked when its not

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12117 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-12-01 03:10:48 +00:00
parent 8d782bc7ee
commit bbf4d7eab5
2 changed files with 13 additions and 4 deletions

View File

@ -410,15 +410,23 @@ void UnlockManager::updateActiveChallengeList()
void UnlockManager::findWhatWasUnlocked(int pointsBefore, int pointsNow,
std::vector<std::string>& tracks,
std::vector<std::string>& gps)
{printf("pointsBefore : %i, pointsNow: %i\n", pointsBefore, pointsNow);
{
for (AllChallengesType::iterator it = m_all_challenges.begin();
it != m_all_challenges.end(); it++)
{
ChallengeData* c = it->second;
if (c->getNumTrophies() > pointsBefore && c->getNumTrophies() <= pointsNow)
{
if (c->getTrackId() != "") tracks.push_back(c->getTrackId());
else if (c->getGPId() != "") gps.push_back(c->getGPId());
if (c->getTrackId() != "")
{
if (!getCurrentSlot()->isLocked(c->getTrackId()))
tracks.push_back(c->getTrackId());
}
else if (c->getGPId() != "")
{
if (!getCurrentSlot()->isLocked(c->getGPId()))
gps.push_back(c->getGPId());
}
}
}
}

View File

@ -149,7 +149,8 @@ void FeatureUnlockedCutScene::findWhatWasUnlocked(RaceManager::Difficulty diffic
std::vector<std::string> tracks;
std::vector<std::string> gps;
unlock_manager->updateActiveChallengeList();
unlock_manager->findWhatWasUnlocked(pointsBefore, pointsNow, tracks, gps);
for (unsigned int i = 0; i < tracks.size(); i++)