Skip to content
Snippets Groups Projects
Commit 9b25ab27 authored by MascaraSnake's avatar MascaraSnake
Browse files

Merge branch 'stop-sound-by-id' into 'next'

S_StopSoundByID Lua support

See merge request !925
parents 5d7bea64 d0376e28
No related branches found
No related tags found
2 merge requests!985Shaders next merge,!925S_StopSoundByID Lua support
......@@ -2458,6 +2458,21 @@ static int lib_sStopSound(lua_State *L)
return 0;
}
static int lib_sStopSoundByID(lua_State *L)
{
void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
//NOHUD
if (!origin)
return LUA_ErrInvalid(L, "mobj_t");
sfxenum_t sound_id = luaL_checkinteger(L, 2);
if (sound_id >= NUMSFX)
return luaL_error(L, "sfx %d out of range (0 - %d)", sound_id, NUMSFX-1);
S_StopSoundByID(origin, sound_id);
return 0;
}
static int lib_sChangeMusic(lua_State *L)
{
#ifdef MUSICSLOT_COMPATIBILITY
......@@ -3253,6 +3268,7 @@ static luaL_Reg lib[] = {
{"S_StartSound",lib_sStartSound},
{"S_StartSoundAtVolume",lib_sStartSoundAtVolume},
{"S_StopSound",lib_sStopSound},
{"S_StopSoundByID",lib_sStopSoundByID},
{"S_ChangeMusic",lib_sChangeMusic},
{"S_SpeedMusic",lib_sSpeedMusic},
{"S_StopMusic",lib_sStopMusic},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment