Fix missing place sound when placing last torch

This commit is contained in:
Wuzzy 2017-03-10 20:30:33 +01:00
parent f9effa6082
commit 4157d52811
1 changed files with 3 additions and 2 deletions

View File

@ -91,7 +91,9 @@ mcl_torches.register_torch = function(substring, description, icon, mesh_floor,
end end
end end
local fakestack = itemstack local itemstring = itemstack:get_name()
local fakestack = ItemStack(itemstack)
local idef = fakestack:get_definition()
local retval local retval
if wdir == 0 then 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, success = minetest.item_place(fakestack, placer, pointed_thing, wdir)
itemstack:set_name(itemstring) itemstack:set_name(itemstring)
local idef = itemstack:get_definition()
if success and 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}) minetest.sound_play(idef.sounds.place, {pos=under, gain=1})
end end