diff --git a/Source/Entities/DynamicSong.cpp b/Source/Entities/DynamicSong.cpp index cd391daa7f..ef71cb244c 100644 --- a/Source/Entities/DynamicSong.cpp +++ b/Source/Entities/DynamicSong.cpp @@ -167,6 +167,8 @@ SoundContainer& DynamicSongSection::SelectTransitionSoundContainer() { } SoundContainer& DynamicSongSection::SelectSoundContainer() { + RTEAssert(!m_SoundContainers.empty(), "Tried to get a SoundContainer from a DynamicSongSection with none to choose from!"); + // Shuffle between our options if we have multiple if (m_SoundContainers.size() > 1) { if (m_ShuffleUnplayedIndices.empty()) { @@ -199,8 +201,7 @@ SoundContainer& DynamicSongSection::SelectSoundContainer() { } } } - - RTEAssert(!m_SoundContainers.empty(), "Tried to get a SoundContainer from a DynamicSongSection with none to choose from!"); + return m_SoundContainers[0]; } diff --git a/Source/Managers/MusicMan.cpp b/Source/Managers/MusicMan.cpp index ff651df695..2c0cc57b02 100644 --- a/Source/Managers/MusicMan.cpp +++ b/Source/Managers/MusicMan.cpp @@ -100,6 +100,7 @@ void MusicMan::ResetMusicState() { bool MusicMan::PlayDynamicSong(const std::string& songName, const std::string& songSectionType, bool playImmediately, bool playTransition, bool smoothFade) { if (const DynamicSong* dynamicSongToPlay = dynamic_cast(g_PresetMan.GetEntityPreset("DynamicSong", songName))) { + m_NextSongSection = nullptr; m_CurrentSong = std::unique_ptr(dynamic_cast(dynamicSongToPlay->Clone())); SetNextSongSectionType(songSectionType); SelectNextSongSection();