From 4157d528111514d4d6cb2c86cffceb9ddb2ca2fd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 10 Mar 2017 20:30:33 +0100 Subject: [PATCH] Fix missing place sound when placing last torch --- mods/ITEMS/mcl_torches/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_torches/init.lua b/mods/ITEMS/mcl_torches/init.lua index 95218cd51d..87efe1df21 100644 --- a/mods/ITEMS/mcl_torches/init.lua +++ b/mods/ITEMS/mcl_torches/init.lua @@ -91,7 +91,9 @@ mcl_torches.register_torch = function(substring, description, icon, mesh_floor, end end - local fakestack = itemstack + local itemstring = itemstack:get_name() + local fakestack = ItemStack(itemstack) + local idef = fakestack:get_definition() local retval if wdir == 0 then @@ -109,7 +111,6 @@ mcl_torches.register_torch = function(substring, description, icon, mesh_floor, itemstack, success = minetest.item_place(fakestack, placer, pointed_thing, wdir) itemstack:set_name(itemstring) - local idef = itemstack:get_definition() if success and idef.sounds and idef.sounds.place then minetest.sound_play(idef.sounds.place, {pos=under, gain=1}) end