'Better' fix for incorrect time in easter egg mode - thanks to

Devee for diagnosing the problem!


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14512 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-11-21 01:50:46 +00:00
parent 5ea57efaac
commit a97430c882
3 changed files with 10 additions and 3 deletions

View File

@ -221,3 +221,11 @@ void EasterEggHunt::terminateRace()
m_karts[0]->getControls().reset();
WorldWithRank::terminateRace();
}
//-----------------------------------------------------------------------------
/** In Easter Egg mode the finish time is just the time the race is over,
* since there are no AI karts.
*/
float EasterEggHunt::estimateFinishTimeForKart(AbstractKart* kart)
{
return getTime();
} // estimateFinishTimeForKart

View File

@ -66,6 +66,8 @@ public:
void readData(const std::string &filename);
virtual void checkForWrongDirection(unsigned int i) OVERRIDE;
virtual float estimateFinishTimeForKart(AbstractKart* kart) OVERRIDE;
}; // EasterEggHunt

View File

@ -549,9 +549,6 @@ void LinearWorld::getKartsDisplayInfo(
*/
float LinearWorld::estimateFinishTimeForKart(AbstractKart* kart)
{
if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_EASTER_EGG)
return getTime();
const KartInfo &kart_info = m_kart_info[kart->getWorldKartId()];
float full_distance = race_manager->getNumLaps()