diff options
author | red-001 <red-001@outlook.ie> | 2017-04-06 07:14:31 +0100 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-04-06 08:14:31 +0200 |
commit | 4ee6be856d435dff010244c910d5dafe2bfbeb1e (patch) | |
tree | 43557d528d75584851e199342827c320a57bee46 /src/script/lua_api/l_sound.cpp | |
parent | 6da828c471768f2a9efadce7dd51c6cdc5cde6cc (diff) | |
download | minetest-4ee6be856d435dff010244c910d5dafe2bfbeb1e.tar.gz minetest-4ee6be856d435dff010244c910d5dafe2bfbeb1e.tar.bz2 minetest-4ee6be856d435dff010244c910d5dafe2bfbeb1e.zip |
[CSM] Add support for positional audio. (#5516)
Fixes parts of #5389.
Diffstat (limited to 'src/script/lua_api/l_sound.cpp')
-rw-r--r-- | src/script/lua_api/l_sound.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/script/lua_api/l_sound.cpp b/src/script/lua_api/l_sound.cpp index 774b5be0c..07ce36daa 100644 --- a/src/script/lua_api/l_sound.cpp +++ b/src/script/lua_api/l_sound.cpp @@ -30,12 +30,7 @@ int ModApiSound::l_sound_play(lua_State *L) read_soundspec(L, 1, spec); bool looped = lua_toboolean(L, 2); - s32 handle; - if (Client *client = getClient(L)) - handle = client->getSoundManager()->playSound(spec, looped); - // Main menu doesn't have access to client, use guiEngine - else - handle = getGuiEngine(L)->playSound(spec, looped); + s32 handle = getGuiEngine(L)->playSound(spec, looped); lua_pushinteger(L, handle); @@ -46,11 +41,7 @@ int ModApiSound::l_sound_stop(lua_State *L) { u32 handle = luaL_checkinteger(L, 1); - if (Client *client = getClient(L)) - client->getSoundManager()->stopSound(handle); - // Main menu doesn't have access to client, use guiEngine - else - getGuiEngine(L)->stopSound(handle); + getGuiEngine(L)->stopSound(handle); return 1; } |