Index: lua.cpp =================================================================== --- lua.cpp (revision 10474) +++ lua.cpp (working copy) @@ -11780,21 +11780,31 @@ return ade_set_args(L, "i", ah); } -ADE_FUNC(stopMusic, l_Audio, "int audiohandle, [bool fade = false]", "Stops a playing music file, provided audiohandle is valid", NULL, NULL) +extern int Briefing_music_handle; +ADE_FUNC(stopMusic, l_Audio, "int audiohandle, [bool fade = false], [bool briefing = false]", "Stops a playing music file, provided audiohandle is valid. If briefing is set to true, this will stop the briefing music despite the audiohandle given.", NULL, NULL) { int ah; bool fade = false; - if(!ade_get_args(L, "i|b", &ah, &fade)) + bool briefing = false; + + if(!ade_get_args(L, "i|b", &ah, &fade, &briefing)) return ADE_RETURN_NIL; if (ah >= MAX_AUDIO_STREAMS || ah < 0 ) return ADE_RETURN_NIL; - audiostream_close_file(ah, fade); + if (briefing == true) { + audiostream_close_file(Briefing_music_handle, fade); + Briefing_music_handle = -1; + } + else + audiostream_close_file(ah, fade); + return ADE_RETURN_NIL; } + //**********LIBRARY: Base ade_lib l_Base("Base", NULL, "ba", "Base FreeSpace 2 functions"); @@ -16318,4 +16328,4 @@ //***End LUA fputs("\n", fp); -} +} \ No newline at end of file