From a993ed6f061191d54cb035302f5174534988b420 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 22 Feb 2017 17:17:20 +0100 Subject: [PATCH] Don't play place sound when failed to place torch --- mods/ITEMS/mcl_torches/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_torches/init.lua b/mods/ITEMS/mcl_torches/init.lua index 566dff09..98109086 100644 --- a/mods/ITEMS/mcl_torches/init.lua +++ b/mods/ITEMS/mcl_torches/init.lua @@ -71,11 +71,11 @@ mcl_torches.register_torch = function(substring, description, icon, mesh_floor, return itemstack end - itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir) + itemstack, success = minetest.item_place(fakestack, placer, pointed_thing, wdir) itemstack:set_name(itemstring) local idef = itemstack:get_definition() - if idef.sounds and idef.sounds.place then + if success and idef.sounds and idef.sounds.place then minetest.sound_play(idef.sounds.place, {pos=under, gain=1}) end return itemstack