Fix crash on player joining
parent
83d48fe2cb
commit
4a815cd04e
4
init.lua
4
init.lua
|
@ -7,7 +7,7 @@ to this software to the public domain worldwide. This software is
|
||||||
distributed without any warranty.
|
distributed without any warranty.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local MAX_INACTIVE_TIME = 300
|
local MAX_INACTIVE_TIME = 20
|
||||||
local CHECK_INTERVAL = 1
|
local CHECK_INTERVAL = 1
|
||||||
local WARN_TIME = 20
|
local WARN_TIME = 20
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
--Loop through each player in players
|
--Loop through each player in players
|
||||||
for playerName,_ in pairs(players) do
|
for playerName,_ in pairs(players) do
|
||||||
local player = minetest.get_player_by_name(playerName)
|
local player = minetest.get_player_by_name(playerName)
|
||||||
|
if player then
|
||||||
|
|
||||||
--Check for inactivity once every CHECK_INTERVAL seconds
|
--Check for inactivity once every CHECK_INTERVAL seconds
|
||||||
checkTimer = checkTimer + dtime
|
checkTimer = checkTimer + dtime
|
||||||
|
@ -63,4 +64,5 @@ minetest.register_globalstep(function(dtime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue