From 1743b8791bc34bce203dc9c528b285e79a3e1122 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 25 Jul 2022 01:47:54 +0200 Subject: [PATCH] Fix long globalstep for inactive shields --- mods/ITEMS/mcl_shields/init.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_shields/init.lua b/mods/ITEMS/mcl_shields/init.lua index 0ba02c1bb3..eb7d45ff96 100644 --- a/mods/ITEMS/mcl_shields/init.lua +++ b/mods/ITEMS/mcl_shields/init.lua @@ -219,12 +219,11 @@ end local shield_hud = {} local function remove_shield_hud(player) - if shield_hud[player] then - player:hud_remove(shield_hud[player]) - shield_hud[player] = nil - set_shield(player, false, 1) - set_shield(player, false, 2) - end + if not shield_hud[player] then return end --this function takes a long time. only run it when necessary + player:hud_remove(shield_hud[player]) + shield_hud[player] = nil + set_shield(player, false, 1) + set_shield(player, false, 2) local hf = player:hud_get_flags() if not hf.wielditem then