Skip to content

Commit 851368b

Browse files
committed
fix playback of generic music without a set ExitTime
1 parent f7eaf81 commit 851368b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Source/Managers/MusicMan.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,12 @@ bool MusicMan::CyclePlayingSoundContainers(bool smoothFade) {
177177
// Clone instead of just point to because we might wanna keep this around even if the DynamicSong is gone
178178
m_CurrentSoundContainer = std::unique_ptr<SoundContainer>(dynamic_cast<SoundContainer*>(m_NextSoundContainer->Clone()));
179179
SelectNextSoundContainer();
180-
181-
double timeUntilNextShouldBePlayed = std::max(0.0F, m_CurrentSoundContainer->GetMusicExitTime() - m_NextSoundContainer->GetMusicPreEntryTime());
182180
m_MusicTimer.Reset();
181+
float exitTime = m_CurrentSoundContainer->GetMusicExitTime();
182+
if (exitTime == 0.0F) {
183+
exitTime = m_CurrentSoundContainer->GetLength(SoundContainer::LengthOfSoundType::NextPlayed);
184+
}
185+
double timeUntilNextShouldBePlayed = std::max(0.0F, exitTime - m_NextSoundContainer->GetMusicPreEntryTime());
183186
m_MusicTimer.SetRealTimeLimitMS(timeUntilNextShouldBePlayed);
184187
m_CurrentSoundContainer->Play();
185188
m_CurrentSongSectionType = m_NextSongSectionType;

0 commit comments

Comments
 (0)