diff options
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_server.cpp | 9 | ||||
-rw-r--r-- | src/script/lua_api/l_sound.cpp | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index 4b0b45887..a5daae346 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -437,16 +437,15 @@ int ModApiServer::l_get_worldpath(lua_State *L) int ModApiServer::l_sound_play(lua_State *L) { NO_MAP_LOCK_REQUIRED; - SimpleSoundSpec spec; - read_soundspec(L, 1, spec); - ServerSoundParams params; + ServerPlayingSound params; + read_soundspec(L, 1, params.spec); read_server_sound_params(L, 2, params); bool ephemeral = lua_gettop(L) > 2 && readParam<bool>(L, 3); if (ephemeral) { - getServer(L)->playSound(spec, params, true); + getServer(L)->playSound(params, true); lua_pushnil(L); } else { - s32 handle = getServer(L)->playSound(spec, params); + s32 handle = getServer(L)->playSound(params); lua_pushinteger(L, handle); } return 1; diff --git a/src/script/lua_api/l_sound.cpp b/src/script/lua_api/l_sound.cpp index b86eda53e..934b4a07e 100644 --- a/src/script/lua_api/l_sound.cpp +++ b/src/script/lua_api/l_sound.cpp @@ -28,9 +28,9 @@ int ModApiSound::l_sound_play(lua_State *L) { SimpleSoundSpec spec; read_soundspec(L, 1, spec); - bool looped = readParam<bool>(L, 2); + spec.loop = readParam<bool>(L, 2); - s32 handle = getGuiEngine(L)->playSound(spec, looped); + s32 handle = getGuiEngine(L)->playSound(spec); lua_pushinteger(L, handle); |