From 426f40dd521c2fa8c99921edb66a1960328e11db Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 20 Apr 2020 15:08:33 +0300 Subject: [PATCH] - fixed crash when loading saved game that has no music --- src/sound/s_doomsound.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/sound/s_doomsound.cpp b/src/sound/s_doomsound.cpp index 4887f8e5c..371a70d4d 100644 --- a/src/sound/s_doomsound.cpp +++ b/src/sound/s_doomsound.cpp @@ -118,15 +118,6 @@ public: static FString LookupMusic(const char* musicname, int& order) { - if (strnicmp(musicname, ",CD,", 4) == 0) - { - static bool warned = false; - if (!warned) - Printf(TEXTCOLOR_RED "CD Audio no longer supported\n"); - warned = true; - return ""; - } - // allow specifying "*" as a placeholder to play the level's default music. if (musicname != nullptr && !strcmp(musicname, "*")) { @@ -146,6 +137,16 @@ static FString LookupMusic(const char* musicname, int& order) // got nothing, return nothing. return ""; } + + if (strnicmp(musicname, ",CD,", 4) == 0) + { + static bool warned = false; + if (!warned) + Printf(TEXTCOLOR_RED "CD Audio no longer supported\n"); + warned = true; + return ""; + } + if (*musicname == '/') musicname++; FString DEH_Music;