Fix global variable warning

This commit is contained in:
Wuzzy 2016-12-29 05:44:26 +01:00
parent a8f4bae325
commit d924625eb2
1 changed files with 2 additions and 2 deletions

View File

@ -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,