diff --git a/src/modes/easter_egg_hunt.cpp b/src/modes/easter_egg_hunt.cpp index 8e5f1e3b4..ec74d98ca 100644 --- a/src/modes/easter_egg_hunt.cpp +++ b/src/modes/easter_egg_hunt.cpp @@ -33,6 +33,7 @@ EasterEggHunt::EasterEggHunt() : LinearWorld() m_use_highscores = true; m_eggs_found = 0; m_only_ghosts = false; + m_finish_time = 0; } // EasterEggHunt //----------------------------------------------------------------------------- @@ -191,7 +192,11 @@ void EasterEggHunt::update(int ticks) bool EasterEggHunt::isRaceOver() { if(!m_only_ghosts && m_eggs_found == m_number_of_eggs) + { + if (m_finish_time == 0) + m_finish_time = getTime(); return true; + } else if (m_only_ghosts) { for (unsigned int i=0 ; igetGhostFinishTime(); } - return getTime(); + return m_finish_time; } // estimateFinishTimeForKart diff --git a/src/modes/easter_egg_hunt.hpp b/src/modes/easter_egg_hunt.hpp index f7a19aebe..ba5e5eaf9 100644 --- a/src/modes/easter_egg_hunt.hpp +++ b/src/modes/easter_egg_hunt.hpp @@ -45,6 +45,8 @@ private: int m_eggs_found; bool m_only_ghosts; + + float m_finish_time; public: EasterEggHunt(); virtual ~EasterEggHunt();