summaryrefslogtreecommitdiff
path: root/src/scriptapi_item.cpp
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-03-25 23:59:17 +0100
committerPilzAdam <pilzadam@minetest.net>2013-03-29 20:14:18 +0100
commit5e7e0347cdae0cab3b7d003fbd3b22c7f820e703 (patch)
treefd7b2b8b1c9564ac0418570ab54238722d2b8880 /src/scriptapi_item.cpp
parent7d9329ecfe84733cdefa34eab25ee3d124c94c59 (diff)
downloadminetest-5e7e0347cdae0cab3b7d003fbd3b22c7f820e703.tar.gz
minetest-5e7e0347cdae0cab3b7d003fbd3b22c7f820e703.tar.bz2
minetest-5e7e0347cdae0cab3b7d003fbd3b22c7f820e703.zip
Add different place sound for nodes
Diffstat (limited to 'src/scriptapi_item.cpp')
-rw-r--r--src/scriptapi_item.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/scriptapi_item.cpp b/src/scriptapi_item.cpp
index 204939f8f..b266d856d 100644
--- a/src/scriptapi_item.cpp
+++ b/src/scriptapi_item.cpp
@@ -96,6 +96,14 @@ ItemDefinition read_item_definition(lua_State *L, int index,
read_groups(L, -1, def.groups);
lua_pop(L, 1);
+ lua_getfield(L, index, "sounds");
+ if(lua_istable(L, -1)){
+ lua_getfield(L, -1, "place");
+ read_soundspec(L, -1, def.sound_place);
+ lua_pop(L, 1);
+ }
+ lua_pop(L, 1);
+
// Client shall immediately place this node when player places the item.
// Server will update the precise end result a moment later.
// "" = no prediction