This commit is contained in:
Alayan 2018-11-13 16:11:28 +01:00
parent 5db7358921
commit e56a9bdf58
2 changed files with 14 additions and 12 deletions

View File

@ -170,7 +170,7 @@
<near-ground distance="2"/>
<!-- How long the end animation will be shown. -->
<delay-finish time="0.5"/>
<delay-finish time="1.0"/>
<!-- How long the music credits are shown. -->
<credits music="10"/>

View File

@ -993,17 +993,19 @@ void Kart::finishedRace(float time, bool from_server)
RaceGUIBase* m = World::getWorld()->getRaceGUI();
if (m)
{
if (race_manager->
getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER &&
getPosition() == 2)
m->addMessage(_("You won the race!"), this, 2.0f);
else if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_NORMAL_RACE ||
race_manager->getMinorMode() == RaceManager::MINOR_MODE_TIME_TRIAL)
{
m->addMessage((getPosition() == 1 ?
_("You won the race!") : _("You finished the race!")) ,
this, 2.0f);
}
bool won_the_race = false;
unsigned int win_position = 1;
if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER)
win_position = 2;
if (getPosition() == (int)win_position &&
World::getWorld()->getNumKarts() > win_position)
won_the_race = true;
m->addMessage((won_the_race ?
_("You won the race!") : _("You finished the race!")) ,
this, 2.0f, video::SColor(255, 255, 255, 255), true, true, true);
}
}