From ea41ff565484c6551ab5df346345af053c8cc589 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Sun, 28 Jul 2019 18:03:32 -0500 Subject: [PATCH] Update init.lua --- init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/init.lua b/init.lua index 084eccf..fc6abfe 100644 --- a/init.lua +++ b/init.lua @@ -124,6 +124,19 @@ function clear_tphr_list(name) 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) if minetest.check_player_privs(sender, {tp_admin = true}) and enable_immediate_teleport 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 if not source or not target then + minetest.chat_send_player(name, S("@1 just disconnected/left (by timeout).", name2)) return end