aboutsummaryrefslogtreecommitdiff
path: root/src/script/common
diff options
context:
space:
mode:
authorRui <rui.minetest@gmail.com>2017-06-11 20:58:26 +0900
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-06-11 13:58:26 +0200
commitff73c7a5da6ab8ac0bb678ebf25b83e805397029 (patch)
tree1e91e8226000250c4636bbb188330d105c85d019 /src/script/common
parent03ff53e16bafe1aaa278625864c546a525d08dfc (diff)
downloadminetest-ff73c7a5da6ab8ac0bb678ebf25b83e805397029.tar.gz
minetest-ff73c7a5da6ab8ac0bb678ebf25b83e805397029.tar.bz2
minetest-ff73c7a5da6ab8ac0bb678ebf25b83e805397029.zip
Sound: Add pitch option (#5960)
* Sound: Add pitch option
Diffstat (limited to 'src/script/common')
-rw-r--r--src/script/common/c_content.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 9be9d7717..3ee6913c9 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -925,6 +925,7 @@ void read_server_sound_params(lua_State *L, int index,
getfloatfield(L, index, "gain", params.gain);
getstringfield(L, index, "to_player", params.to_player);
getfloatfield(L, index, "fade", params.fade);
+ getfloatfield(L, index, "pitch", params.pitch);
lua_getfield(L, index, "pos");
if(!lua_isnil(L, -1)){
v3f p = read_v3f(L, -1)*BS;
@@ -958,6 +959,7 @@ void read_soundspec(lua_State *L, int index, SimpleSoundSpec &spec)
getstringfield(L, index, "name", spec.name);
getfloatfield(L, index, "gain", spec.gain);
getfloatfield(L, index, "fade", spec.fade);
+ getfloatfield(L, index, "pitch", spec.pitch);
} else if(lua_isstring(L, index)){
spec.name = lua_tostring(L, index);
}
@@ -972,6 +974,8 @@ void push_soundspec(lua_State *L, const SimpleSoundSpec &spec)
lua_setfield(L, -2, "gain");
lua_pushnumber(L, spec.fade);
lua_setfield(L, -2, "fade");
+ lua_pushnumber(L, spec.pitch);
+ lua_setfield(L, -2, "pitch");
}
/******************************************************************************/