From 9f6ccaf386d405805438fea1d966badb0653a04b Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 7 Nov 2017 00:31:00 +0000 Subject: [PATCH] Fix mistake during introduction of canafk priv --- mods/afkkick/init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/afkkick/init.lua b/mods/afkkick/init.lua index 9f0ff56..65e2dbf 100644 --- a/mods/afkkick/init.lua +++ b/mods/afkkick/init.lua @@ -39,10 +39,9 @@ minetest.register_globalstep(function(dtime) for playerName,_ in pairs(players) do local player = minetest.get_player_by_name(playerName) if player then - --Check for inactivity once every CHECK_INTERVAL seconds checkTimer = checkTimer + dtime - if checkTimer > CHECK_INTERVAL and not minetest.check_player_privs({ canafk = true }) then + if checkTimer > CHECK_INTERVAL and not minetest.check_player_privs(player, { canafk = true }) then checkTimer = 0 --Kick player if he/she has been inactive for longer than MAX_INACTIVE_TIME seconds