diff --git a/src/acs/call-funcs.cpp b/src/acs/call-funcs.cpp index 72f95bfba..12fdd56c5 100644 --- a/src/acs/call-funcs.cpp +++ b/src/acs/call-funcs.cpp @@ -339,8 +339,6 @@ static bool ACS_CountThing(mobj_t *mobj, mobjtype_t type) return false; } -// Unused, but it's here if you need it. -#if 0 /*-------------------------------------------------- static bool ACS_ActivatorIsLocal(ACSVM::Thread *thread) @@ -368,7 +366,6 @@ static bool ACS_ActivatorIsLocal(ACSVM::Thread *thread) return false; } -#endif /*-------------------------------------------------- static UINT32 ACS_SectorThingCounter(sector_t *sec, mtag_t thingTag, bool (*filter)(mobj_t *)) @@ -2184,6 +2181,14 @@ bool CallFunc_MusicPlay(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::W { ACSVM::MapScope *map = thread->scopeMap; + // 0: str tune - id for the tune to play + // 1: [bool foractivator] - only do this if the activator is a player and is being viewed + + if (argC > 1 && argV[1] && !ACS_ActivatorIsLocal(thread)) + { + return false; + } + Music_Play(map->getString(argV[0])->str); return false; @@ -2196,6 +2201,13 @@ bool CallFunc_MusicPlay(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::W --------------------------------------------------*/ bool CallFunc_MusicStopAll(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC) { + // 0: [bool foractivator] - only do this if the activator is a player and is being viewed + + if (argC > 0 && argV[0] && !ACS_ActivatorIsLocal(thread)) + { + return false; + } + Music_StopAll(); return false; @@ -2210,6 +2222,15 @@ bool CallFunc_MusicRemap(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM:: { ACSVM::MapScope *map = thread->scopeMap; + // 0: str tune - id for the tune to play + // 1: str song - lump name for the song to map to + // 2: [bool foractivator] - only do this if the activator is a player and is being viewed + + if (argC > 2 && argV[2] && !ACS_ActivatorIsLocal(thread)) + { + return false; + } + Music_Remap(map->getString(argV[0])->str, map->getString(argV[1])->str); return false;