Skip to content

Commit

Permalink
Merge branch 'titlefix' into 'master'
Browse files Browse the repository at this point in the history
Repeat title music only in main menu

See merge request OpenMW/openmw!3436
  • Loading branch information
psi29a committed Sep 19, 2023
2 parents 3ae189d + 3ef9b85 commit 38d0ece
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/openmw/mwsound/soundmanagerimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/statemanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp"

#include "../mwworld/cellstore.hpp"
Expand Down Expand Up @@ -1135,15 +1136,18 @@ namespace MWSound
return;

MWBase::StateManager::State state = MWBase::Environment::get().getStateManager()->getState();
if (state == MWBase::StateManager::State_NoGame && !isMusicPlaying())
bool isMainMenu = MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu)
&& state == MWBase::StateManager::State_NoGame;

if (isMainMenu && !isMusicPlaying())
{
std::string titlefile = "music/special/morrowind title.mp3";
if (mVFS->exists(titlefile))
streamMusic(titlefile, MWSound::MusicType::Special);
}

updateSounds(duration);
if (MWBase::Environment::get().getStateManager()->getState() != MWBase::StateManager::State_NoGame)
if (state != MWBase::StateManager::State_NoGame)
{
updateRegionSound(duration);
updateWaterSound();
Expand Down

0 comments on commit 38d0ece

Please sign in to comment.