Fixed bug

This commit is contained in:
Billy S 2018-12-23 16:13:05 -05:00 committed by GitHub
parent a2c9cad39d
commit afb7bb7b9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,11 +12,13 @@ local function step()
for _, player in pairs(minetest.get_connected_players()) do for _, player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name() local name = player:get_player_name()
local info = minetest.get_player_information(name) local info = minetest.get_player_information(name)
-- 2.0 seconds. if info ~= nil then
if info.avg_jitter > 2.0 and not players_glitching[name] then -- 2.0 seconds.
players_glitching[name] = player:get_pos() if info.avg_jitter > 2.0 and not players_glitching[name] then
elseif info.avg_jitter < 2.0 and players_glitching[name] then players_glitching[name] = player:get_pos()
minetest.after(0.5, function() players_glitching[name] = nil end) elseif info.avg_jitter < 2.0 and players_glitching[name] then
minetest.after(0.5, function() players_glitching[name] = nil end)
end
end end
end end
minetest.after(1, step) minetest.after(1, step)