mirror of
https://repo.or.cz/minetest_returnmirror.git
synced 2024-09-25 14:20:23 +02:00
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)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
local dest_string = itemstack:get_metadata()
|
local dest_string = itemstack:get_metadata()
|
||||||
local dest = minetest.string_to_pos(dest_string)
|
local dest = minetest.string_to_pos(dest_string)
|
||||||
|
local src = user:getpos()
|
||||||
local fail = true
|
local fail = true
|
||||||
if dest ~= nil then
|
if dest ~= nil then
|
||||||
if returnmirror.mana_check(user, returnmirror.cost_teleport) then
|
if returnmirror.mana_check(user, returnmirror.cost_teleport) then
|
||||||
fail = false
|
fail = false
|
||||||
local src = user:getpos()
|
|
||||||
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=src, max_hear_distance=30})
|
minetest.sound_play( {name="returnmirror_teleport", gain=1}, {pos=src, max_hear_distance=30})
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 50,
|
amount = 50,
|
||||||
|
@ -133,7 +133,7 @@ minetest.register_tool("returnmirror:mirror_active", {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if fail then
|
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
|
||||||
end,
|
end,
|
||||||
on_place = returnmirror.set_position_active,
|
on_place = returnmirror.set_position_active,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user