diff --git a/init.lua b/init.lua index 22b70b9..9275bbe 100644 --- a/init.lua +++ b/init.lua @@ -47,8 +47,8 @@ returnmirror.set_position_inactive = function(itemstack, user, pointed_thing) end end + local pos = user:getpos() if returnmirror.mana_check(user, returnmirror.cost_set) then - local pos = user:getpos() local newitem = ItemStack("returnmirror:mirror_active") newitem:set_metadata(minetest.pos_to_string(pos)) minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12}) @@ -69,8 +69,8 @@ returnmirror.set_position_active = function(itemstack, user, pointed_thing) end end + local pos = user:getpos() if returnmirror.mana_check(user, returnmirror.cost_set) then - local pos = user:getpos() itemstack:set_metadata(minetest.pos_to_string(pos)) minetest.sound_play( {name="returnmirror_set", gain=1}, {pos=pos, max_hear_distance=12}) return itemstack