From 64c74cd661361ddb511d543e1710fed1dec61ba0 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Wed, 22 Oct 2025 14:28:22 -0400 Subject: [PATCH] Update ACS music change commands to modify mapmusname to keep music persistant --- src/acs/call-funcs.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/acs/call-funcs.cpp b/src/acs/call-funcs.cpp index 8850cd0fd..d06fb555b 100644 --- a/src/acs/call-funcs.cpp +++ b/src/acs/call-funcs.cpp @@ -3188,9 +3188,17 @@ bool CallFunc_MusicPlay(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::W { return false; } - - S_ChangeMusicEx(map->getString(argV[0])->str, 0, true, mapmusposition, 0, 0); + boolean musicsame = !strnicmp(map->getString(argV[0])->str, mapmusname, 7); + + if (!musicsame) + { + S_ChangeMusicEx(map->getString(argV[0])->str, 0, true, mapmusposition, 0, 0); + + strncpy(mapmusname, S_MusicName(), 7); + mapmusname[6] = 0; + } + return false; } @@ -3231,8 +3239,16 @@ bool CallFunc_MusicRemap(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM:: { return false; } - - S_ChangeMusicEx(map->getString(argV[0])->str, 0, true, lastmapmusposition, 0, 0); + + boolean musicsame = !strnicmp(map->getString(argV[0])->str, mapmusname, 7); + + if (!musicsame) + { + S_ChangeMusicEx(map->getString(argV[0])->str, 0, true, lastmapmusposition, 0, 0); + + strncpy(mapmusname, S_MusicName(), 7); + mapmusname[6] = 0; + } return false; }