- fixed crash when loading saved game that has no music

This commit is contained in:
alexey.lysiuk 2020-04-20 15:08:33 +03:00
parent c37dcc6eb4
commit 426f40dd52
1 changed files with 10 additions and 9 deletions

View File

@ -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;