Fix missing place sound when placing last torch
parent
f9effa6082
commit
4157d52811
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue