From b15810e17348d9b011f4d114b6664dcdcded1e68 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 26 Feb 2021 18:58:13 +0100 Subject: [PATCH] - SW: fixed crash with credits screen and CD tracks missing. --- source/games/sw/src/sounds.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index b81bf6b6c..e0343fcd1 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -946,7 +946,7 @@ int PlayerYellVocs[] = bool PlaySong(const char* mapname, const char* song_file_name, int cdaudio_track, bool isThemeTrack) //(nullptr, nullptr, -1, false) starts the normal level music. { // Play CD audio if enabled. - if (cdaudio_track >= 0 && (mus_redbook || *song_file_name == 0)) + if (cdaudio_track >= 0 && (mus_redbook || !song_file_name || *song_file_name == 0)) { FStringf trackname("track%02d.ogg", cdaudio_track); if (!Mus_Play(mapname, trackname, true)) @@ -955,6 +955,10 @@ bool PlaySong(const char* mapname, const char* song_file_name, int cdaudio_track } else return true; } + if (!song_file_name || *song_file_name == 0) + { + return true; + } if (!Mus_Play(mapname, song_file_name, true)) { // try the CD track anyway if no MIDI could be found (the original game doesn't have any MIDI, it was CD Audio only, this avoids no music playing if mus_redbook is off.)