From 2c6af7724250253eb7f97d4ef1a3ba4ec09322df Mon Sep 17 00:00:00 2001 From: david Date: Thu, 22 Jul 2021 15:00:57 -0400 Subject: [PATCH] Fixes #4 It was found that in the CTF repo they fixed this issue... but we just simply didn't apply the fix they did. This was fixed in their repo as issue [623](https://github.com/MT-CTF/capturetheflag/issues/623) --- README.md | 1 + init.lua | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 300e622..e46b2d3 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,4 @@ start to be warned via chat message. - 07/22/2021 Beanzilla added the priv bypass_afk_kick which prevents being kicked for an unlimited amount of time. (Default's to being granted to server admin and if single player) +- 07/22/2021 Beanzilla fixed issue #4 diff --git a/init.lua b/init.lua index 0090263..795938a 100644 --- a/init.lua +++ b/init.lua @@ -7,6 +7,7 @@ to this software to the public domain worldwide. This software is distributed without any warranty. ]] +-- Settings local MAX_INACTIVE_TIME = 300 local CHECK_INTERVAL = 1 local WARN_TIME = 20 @@ -27,6 +28,10 @@ minetest.register_on_leaveplayer(function(player) end) minetest.register_on_chat_message(function(playerName, message) + -- Verify that it's a player and that it is not the terminal + if not playerName or not minetest.get_player_by_name(playerName) then + return -- Abort tracking the last action + end players[playerName]["lastAction"] = minetest.get_gametime() end)