Skip to content

Commit 59c9ae3

Browse files
committed
🐛 Fixed race UI not reset after leaving map during race
1 parent 3fe40a5 commit 59c9ae3

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

source/main/gameplay/RaceSystem.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,10 @@ void RaceSystem::StopRaceTimer()
5959
float RaceSystem::GetRaceTime() const
6060
{
6161
return App::GetGameContext()->GetActorManager()->GetTotalTime() - m_race_start_time;
62-
}
62+
}
63+
64+
void RaceSystem::ResetRaceUI()
65+
{
66+
this->StopRaceTimer();
67+
this->UpdateDirectionArrow(nullptr, Ogre::Vector3::ZERO); // hide arrow
68+
}

source/main/gameplay/RaceSystem.h

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class RaceSystem
3636
bool IsRaceInProgress() const { return m_race_id != -1; }
3737
int GetRaceId() const { return m_race_id; }
3838
float GetRaceTime() const;
39+
void ResetRaceUI();
3940

4041
void SetRaceTimeDiff(float diff) { m_race_time_diff = diff; };
4142
float GetRaceTimeDiff() const { return m_race_time_diff; };

source/main/main.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ int main(int argc, char *argv[])
934934
App::sim_terrain_gui_name->setStr("");
935935
App::GetOutGauge()->Close();
936936
App::GetSoundScriptManager()->setCamera(/*position:*/Ogre::Vector3::ZERO, /*direction:*/Ogre::Vector3::ZERO, /*up:*/Ogre::Vector3::UNIT_Y, /*velocity:*/Ogre::Vector3::ZERO);
937+
App::GetGameContext()->GetRaceSystem().ResetRaceUI();
937938
}
938939
catch (...)
939940
{

0 commit comments

Comments
 (0)