From ec598d6f41205c04288f72e512d6ebbd6645584e Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 10 Feb 2015 17:07:46 +1100 Subject: [PATCH] Start music properly in thread, avoid starting track music more than once. --- src/modes/world_status.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modes/world_status.cpp b/src/modes/world_status.cpp index 60fd52985..c19ae0cd3 100644 --- a/src/modes/world_status.cpp +++ b/src/modes/world_status.cpp @@ -246,9 +246,10 @@ void WorldStatus::update(const float dt) return; case GO_PHASE : - if (m_auxiliary_timer>2.5f && music_manager->getCurrentMusic()) + if (m_auxiliary_timer>2.5f && music_manager->getCurrentMusic() && + !music_manager->getCurrentMusic()->isPlaying()) { - music_manager->startMusic(music_manager->getCurrentMusic()); + music_manager->startMusic(); } if (m_auxiliary_timer > 3.0f) // how long to display the 'go' message @@ -271,7 +272,7 @@ void WorldStatus::update(const float dt) // Start the music here when starting fast if (UserConfigParams::m_race_now) { - music_manager->startMusic(music_manager->getCurrentMusic()); + music_manager->startMusic(); UserConfigParams::m_race_now = false; } // how long to display the 'music' message