From e635de6accf1717637d2727735a1af199a8e253c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 8 Mar 2017 20:18:42 +0100 Subject: [PATCH] Harden security of mcl_item_names --- mods/HUD/mcl_item_names/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/HUD/mcl_item_names/init.lua b/mods/HUD/mcl_item_names/init.lua index 2a71723ddf..8916eb4130 100644 --- a/mods/HUD/mcl_item_names/init.lua +++ b/mods/HUD/mcl_item_names/init.lua @@ -6,6 +6,7 @@ local dtimes = {} local dlimit = 3 -- HUD element will be hidden after this many seconds local function set_hud(player) + if not player:is_player() then return end local player_name = player:get_player_name() local off = {x=0, y=-136} huds[player_name] = player:hud_add({ @@ -19,7 +20,7 @@ local function set_hud(player) end minetest.register_on_joinplayer(function(player) - minetest.after(0, set_hud, player) + set_hud(player) end) minetest.register_globalstep(function(dtime)