From 7a4f352ce4c11582a824f83a4f7db3b875e13c96 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 29 Jan 2023 21:44:53 +0100 Subject: [PATCH] Limit HUDCHANGE pkt sending --- src/hud.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hud.lua b/src/hud.lua index edf5149..f3fa5de 100644 --- a/src/hud.lua +++ b/src/hud.lua @@ -118,8 +118,12 @@ core.register_globalstep(function(dt) local data = i3.data[name] if not data then return end + local has_text = player:hud_get(data.hud.wielditem).text ~= "" + if not data.wielditem_hud then - player:hud_change(data.hud.wielditem, "text", "") + if has_text then + player:hud_change(data.hud.wielditem, "text", "") + end return end @@ -127,7 +131,7 @@ core.register_globalstep(function(dt) local wieldidx = player:get_wield_index() if wieldidx == data.old_wieldidx then - if data.timer >= i3.settings.wielditem_fade_after then + if data.timer >= i3.settings.wielditem_fade_after and has_text then player:hud_change(data.hud.wielditem, "text", "") end return