diff --git a/src/challenges/challenge.hpp b/src/challenges/challenge.hpp index d53fc5585..8217786a8 100644 --- a/src/challenges/challenge.hpp +++ b/src/challenges/challenge.hpp @@ -67,16 +67,6 @@ public: // ------------------------------------------------------------------------ void setActive() {m_state = CH_ACTIVE; } // ------------------------------------------------------------------------ - /** These functions are called when a race is finished. It allows - * the challenge to unlock features (when returning true), otherwise - * the feature remains locked. */ - virtual bool raceFinished() {return false; } - // ------------------------------------------------------------------------ - /** These functions are called when a grand prix is finished. It allows - * the challenge to unlock features (when returning true), otherwise - * the feature remains locked. */ - virtual bool grandPrixFinished() {return false; } - ChallengeData* getData() { return m_data; } }; #endif diff --git a/src/challenges/game_slot.cpp b/src/challenges/game_slot.cpp index 797cc58ae..ef653dc6d 100644 --- a/src/challenges/game_slot.cpp +++ b/src/challenges/game_slot.cpp @@ -171,11 +171,13 @@ std::vector GameSlot::getActiveChallenges() */ void GameSlot::raceFinished() { + printf("=== Race finished ===\n"); + std::map::const_iterator i; for(i = m_challenges_state.begin(); i != m_challenges_state.end(); i++) { - if(i->second->isActive() && i->second->raceFinished()) + if(i->second->isActive() && i->second->getData()->raceFinished()) { unlockFeature(i->second); } // if isActive && challenge solved @@ -191,7 +193,7 @@ void GameSlot::grandPrixFinished() for(i = m_challenges_state.begin(); i != m_challenges_state.end(); i++) { - if(i->second->isActive() && i->second->grandPrixFinished()) + if(i->second->isActive() && i->second->getData()->grandPrixFinished()) { printf("===== A FEATURE WAS UNLOCKED BECAUSE YOU WON THE GP!! ==\n"); unlockFeature(i->second);