mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2024-08-20 13:24:07 +02:00
Removed last of namespace pollution
This commit is contained in:
parent
2aa668c42a
commit
e9e9a0c8a4
33
init.lua
33
init.lua
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
local timeout_delay = 60
|
local timeout_delay = 10
|
||||||
|
|
||||||
-- Set to true to register tpr_admin priv
|
-- Set to true to register tpr_admin priv
|
||||||
local regnewpriv = false
|
local regnewpriv = false
|
||||||
@ -9,25 +9,6 @@ local version = "0.2"
|
|||||||
local tpr_list = {}
|
local tpr_list = {}
|
||||||
local tphr_list = {}
|
local tphr_list = {}
|
||||||
|
|
||||||
--DO NOT CHANGE:------------
|
|
||||||
value_carryover = nil
|
|
||||||
value_carryover2 = nil
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
-- Reset after configured delay.
|
|
||||||
-- These functions cannot be local (not sure if this can be avoided)
|
|
||||||
function reset_request(name)
|
|
||||||
if tpr_list[value_carryover] ~= nil then
|
|
||||||
tpr_list[value_carryover] = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function reset_request2(name)
|
|
||||||
if tphr_list[value_carryover2] ~= nil then
|
|
||||||
tphr_list[value_carryover2] = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--Teleport Request System
|
--Teleport Request System
|
||||||
local function tpr_send(name, param)
|
local function tpr_send(name, param)
|
||||||
|
|
||||||
@ -50,7 +31,11 @@ local function tpr_send(name, param)
|
|||||||
tpr_list[receiver] = nil
|
tpr_list[receiver] = nil
|
||||||
tpr_list[receiver] = sender
|
tpr_list[receiver] = sender
|
||||||
--Teleport timeout delay
|
--Teleport timeout delay
|
||||||
minetest.after(timeout_delay, reset_request)
|
minetest.after(timeout_delay, function(name)
|
||||||
|
if tpr_list[name] ~= nil then
|
||||||
|
tpr_list[name] = nil
|
||||||
|
end
|
||||||
|
end, name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -75,7 +60,11 @@ local function tphr_send(name, param)
|
|||||||
tphr_list[receiver] = nil
|
tphr_list[receiver] = nil
|
||||||
tphr_list[receiver] = sender
|
tphr_list[receiver] = sender
|
||||||
--Teleport timeout delay
|
--Teleport timeout delay
|
||||||
minetest.after(timeout_delay, reset_request2)
|
minetest.after(timeout_delay, function(name)
|
||||||
|
if tphr_list[name] ~= nil then
|
||||||
|
tphr_list[name] = nil
|
||||||
|
end
|
||||||
|
end, name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user