forked from mtcontrib/minetest_returnmirror
Fix global variable warning
This commit is contained in:
parent
a8f4bae325
commit
d924625eb2
4
init.lua
4
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,
|
||||
|
Loading…
Reference in New Issue
Block a user