diff --git a/src/karts/controller/end_controller.cpp b/src/karts/controller/end_controller.cpp index 733b1b8ba..67ae305e5 100644 --- a/src/karts/controller/end_controller.cpp +++ b/src/karts/controller/end_controller.cpp @@ -184,7 +184,8 @@ void EndController::update(float dt) // In case of battle mode: don't do anything if(race_manager->getMinorMode()==RaceManager::MINOR_MODE_3_STRIKES || - race_manager->getMinorMode()==RaceManager::MINOR_MODE_SOCCER) + race_manager->getMinorMode()==RaceManager::MINOR_MODE_SOCCER || + race_manager->getMinorMode()==RaceManager::MINOR_MODE_EASTER_EGG) { m_controls->m_accel = 0.0f; // Brake while we are still driving forwards (if we keep diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 492086311..5354a2841 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -849,6 +849,12 @@ void Kart::finishedRace(float time) setController(new EndController(this, m_controller->getPlayer(), m_controller)); } + else if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_EASTER_EGG) + { + m_kart_model->setAnimation(KartModel::AF_WIN_START); + setController(new EndController(this, m_controller->getPlayer(), + m_controller)); + } } // finishedRace diff --git a/src/modes/easter_egg_hunt.cpp b/src/modes/easter_egg_hunt.cpp index 107df704d..46c45723c 100644 --- a/src/modes/easter_egg_hunt.cpp +++ b/src/modes/easter_egg_hunt.cpp @@ -24,7 +24,7 @@ //----------------------------------------------------------------------------- /** Constructor. Sets up the clock mode etc. */ -EasterEggHunt::EasterEggHunt() : WorldWithRank() +EasterEggHunt::EasterEggHunt() : LinearWorld() { WorldStatus::setClockMode(CLOCK_CHRONO); m_use_highscores = true; @@ -36,7 +36,7 @@ EasterEggHunt::EasterEggHunt() : WorldWithRank() */ void EasterEggHunt::init() { - WorldWithRank::init(); + LinearWorld::init(); m_display_rank = false; // check for possible problems if AI karts were incorrectly added @@ -160,8 +160,8 @@ void EasterEggHunt::collectedEasterEgg(const AbstractKart *kart) */ void EasterEggHunt::update(float dt) { - WorldWithRank::update(dt); - WorldWithRank::updateTrack(dt); + LinearWorld::update(dt); + LinearWorld::updateTrack(dt); } // update //----------------------------------------------------------------------------- @@ -181,7 +181,7 @@ bool EasterEggHunt::isRaceOver() */ void EasterEggHunt::reset() { - WorldWithRank::reset(); + LinearWorld::reset(); for(unsigned int i=0; i @@ -31,7 +31,7 @@ class AbstractKart; * \brief An implementation of World to provide an easter egg hunt like mode * \ingroup modes */ -class EasterEggHunt: public WorldWithRank +class EasterEggHunt: public LinearWorld { private: /** Keeps track of how many eggs each kart has found. */ @@ -64,6 +64,8 @@ public: void updateKartRanks(); void collectedEasterEgg(const AbstractKart *kart); void readData(const std::string &filename); + + virtual void checkForWrongDirection(unsigned int i) OVERRIDE; }; // EasterEggHunt diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 557bd0bc7..148fedfeb 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -1527,9 +1527,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id) } else if(name=="checks") { - // Easter egg hunts don't have laps. - if(race_manager->getMinorMode()!=RaceManager::MINOR_MODE_EASTER_EGG) - CheckManager::get()->load(*node); + CheckManager::get()->load(*node); } else if (name=="particle-emitter") {