]> git.lizzy.rs Git - coronaserver.git/commitdiff
Fix nil value issue 5/head
authorTalkLounge <talklounge@yahoo.de>
Mon, 11 Oct 2021 18:25:50 +0000 (20:25 +0200)
committerGitHub <noreply@github.com>
Mon, 11 Oct 2021 18:25:50 +0000 (20:25 +0200)
playerlist.lua

index a23b02db7c88925f24833f1de579d9991f3df7e4..2ec145cf9f2af8526f56dc84a4e743886752f41c 100644 (file)
@@ -7,7 +7,7 @@ controls.register_on_press(function(player, key)
                for i, p in pairs(players) do
                        local n = p:get_player_name()
                        local info = minetest.get_player_information(n)
-                       if info then
+                       if info and info.avg_rtt then
                                local ping = math.max(1, math.ceil(4 - info.avg_rtt * 4))
                                list[#list + 1] = player:hud_add({
                                        hud_elem_type = "text",