summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_server.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2022-06-20 21:56:12 +0200
committerGitHub <noreply@github.com>2022-06-20 21:56:12 +0200
commita463620edbe57071a7101297d33226507567ca73 (patch)
tree342d433ca55f4e3d1826508c303f2e6229d503f1 /src/script/lua_api/l_server.cpp
parent0b41533763bc9f104a2da2e4191f4654b8d8dab4 (diff)
downloadminetest-a463620edbe57071a7101297d33226507567ca73.tar.gz
minetest-a463620edbe57071a7101297d33226507567ca73.tar.bz2
minetest-a463620edbe57071a7101297d33226507567ca73.zip
Re-order sound-related code (#12382)
Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated 'fade' and 'pitch' values on server-side where only one was used anyway. SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included. Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the future. Per-type version numbers are kept for now as a safety rope in a special case.
Diffstat (limited to 'src/script/lua_api/l_server.cpp')
-rw-r--r--src/script/lua_api/l_server.cpp9
1 files changed, 4 insertions, 5 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;