Allow ride music to loop seamlessly without reload

This commit is contained in:
Ted John 2022-06-08 00:28:57 +01:00
parent 704e68a9b4
commit dda5402644
1 changed files with 2 additions and 1 deletions

View File

@ -226,7 +226,8 @@ namespace OpenRCT2::RideAudio
auto source = audioContext->CreateStreamFromWAV(std::move(stream));
if (source != nullptr)
{
auto channel = Mixer_Play_Music(source, MIXER_LOOP_NONE, true);
auto shouldLoop = musicObj->GetTrackCount() == 1;
auto channel = Mixer_Play_Music(source, shouldLoop ? MIXER_LOOP_INFINITE : MIXER_LOOP_NONE, true);
if (channel != nullptr)
{
_musicChannels.emplace_back(instance, channel, source);