From d924625eb2e16fd21694c71ac665d24556e8c376 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 29 Dec 2016 05:44:26 +0100 Subject: [PATCH] Fix global variable warning --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index bcc93c6..825f03a 100644 --- a/init.lua +++ b/init.lua @@ -96,11 +96,11 @@ minetest.register_tool("returnmirror:mirror_active", { on_use = function(itemstack, user, pointed_thing) local dest_string = itemstack:get_metadata() local dest = minetest.string_to_pos(dest_string) + local src = user:getpos() local fail = true if dest ~= nil then if returnmirror.mana_check(user, returnmirror.cost_teleport) then fail = false - local src = user:getpos() minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=src, max_hear_distance=30}) minetest.add_particlespawner({ amount = 50, @@ -133,7 +133,7 @@ minetest.register_tool("returnmirror:mirror_active", { end end if fail then - minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=pos, max_hear_distance=18}) + minetest.sound_play( {name="returnmirror_fail", gain=1}, {pos=src, max_hear_distance=18}) end end, on_place = returnmirror.set_position_active, -- 2.11.4.GIT