From 1e0366f98f7eae81ade2d860e6f9c9c6596bde19 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 25 Nov 2015 13:27:35 +0100 Subject: [PATCH] - fixed: $musicalias must be resolved before comparing for equality with the currently playing music. --- src/s_sound.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index bacd5aa94..7b38e816c 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -2375,6 +2375,16 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force) } } + FName *aliasp = MusicAliases.CheckKey(musicname); + if (aliasp != NULL) + { + if (*aliasp == NAME_None) + { + return true; // flagged to be ignored + } + musicname = aliasp->GetChars(); + } + if (!mus_playing.name.IsEmpty() && mus_playing.handle != NULL && stricmp (mus_playing.name, musicname) == 0 && @@ -2413,16 +2423,8 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force) int length = 0; int device = MDEV_DEFAULT; MusInfo *handle = NULL; - FName musicasname = musicname; - FName *aliasp = MusicAliases.CheckKey(musicasname); - if (aliasp != NULL) - { - musicname = (musicasname = *aliasp).GetChars(); - if (musicasname == NAME_None) return true; - } - - int *devp = MidiDevices.CheckKey(musicasname); + int *devp = MidiDevices.CheckKey(musicname); if (devp != NULL) device = *devp; // Strip off any leading file:// component.