mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-01-09 06:17:37 +01:00
Update init.lua
This commit is contained in:
parent
07128f83c8
commit
ea41ff5654
14
init.lua
14
init.lua
@ -124,6 +124,19 @@ function clear_tphr_list(name)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Clear requests when the player leaves
|
||||||
|
minetest.register_on_leaveplayer(function(name)
|
||||||
|
if tpr_list[name] then
|
||||||
|
tpr_list[name] = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if tphr_list[name] then
|
||||||
|
tphr_list[name] = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
function tpr_send(sender, receiver)
|
function tpr_send(sender, receiver)
|
||||||
if minetest.check_player_privs(sender, {tp_admin = true}) and enable_immediate_teleport then
|
if minetest.check_player_privs(sender, {tp_admin = true}) and enable_immediate_teleport then
|
||||||
if receiver == "" then
|
if receiver == "" then
|
||||||
@ -294,6 +307,7 @@ function tpr_accept(name, param)
|
|||||||
-- Could happen if either player disconnects (or timeout); if so just abort
|
-- Could happen if either player disconnects (or timeout); if so just abort
|
||||||
if not source
|
if not source
|
||||||
or not target then
|
or not target then
|
||||||
|
minetest.chat_send_player(name, S("@1 just disconnected/left (by timeout).", name2))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user