1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 18:39:43 +00:00

Reset music type to Normal when we are done to scripted music

This commit is contained in:
Andrei Kortunov 2024-06-02 09:44:41 +04:00
parent e762ae9703
commit 402e725d87

View file

@ -16,7 +16,6 @@
#include <components/vfs/recursivedirectoryiterator.hpp> #include <components/vfs/recursivedirectoryiterator.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/statemanager.hpp" #include "../mwbase/statemanager.hpp"
#include "../mwbase/windowmanager.hpp" #include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
@ -305,8 +304,6 @@ namespace MWSound
void SoundManager::streamMusic(VFS::Path::NormalizedView filename, MusicType type, float fade) void SoundManager::streamMusic(VFS::Path::NormalizedView filename, MusicType type, float fade)
{ {
const auto mechanicsManager = MWBase::Environment::get().getMechanicsManager();
// Can not interrupt scripted music by built-in playlists // Can not interrupt scripted music by built-in playlists
if (mMusicType == MusicType::MWScript && type != MusicType::MWScript) if (mMusicType == MusicType::MWScript && type != MusicType::MWScript)
return; return;
@ -1073,6 +1070,8 @@ namespace MWSound
streamMusicFull(mNextMusic); streamMusicFull(mNextMusic);
mNextMusic = VFS::Path::Normalized(); mNextMusic = VFS::Path::Normalized();
} }
else
mMusicType = MusicType::Normal;
} }
else else
{ {
@ -1257,7 +1256,7 @@ namespace MWSound
void SoundManager::clear() void SoundManager::clear()
{ {
SoundManager::stopMusic(); stopMusic();
for (SoundMap::value_type& snd : mActiveSounds) for (SoundMap::value_type& snd : mActiveSounds)
{ {