diff --git a/mods/ITEMS/mcl_shields/init.lua b/mods/ITEMS/mcl_shields/init.lua index 70cb91090..c887218be 100644 --- a/mods/ITEMS/mcl_shields/init.lua +++ b/mods/ITEMS/mcl_shields/init.lua @@ -293,7 +293,11 @@ local function handle_blocking(player) if not_blocking then minetest.after(0.25, function() rmb = player:get_player_control().RMB - if (not_blocking or not shield_in_offhand) and shield_in_hand and rmb and not mcl_hunger.is_eating(player) and mcl_shields.players[player].cooldown == 0 then + local is_eating = false + if mcl_hunger.is_eating then + is_eating = mcl_hunger.is_eating(player) + end + if (not_blocking or not shield_in_offhand) and shield_in_hand and rmb and not is_eating and mcl_shields.players[player].cooldown == 0 then player_shield.blocking = 2 set_shield(player, true, 2) else @@ -325,7 +329,11 @@ local function handle_blocking(player) if not_blocking then minetest.after(0.25, function() rmb = player:get_player_control().RMB - if (not_blocking or not shield_in_hand) and shield_in_offhand and rmb and offhand_can_block and not mcl_hunger.is_eating(player) and mcl_shields.players[player].cooldown == 0 then + local is_eating = false + if mcl_hunger.is_eating then + is_eating = mcl_hunger.is_eating(player) + end + if (not_blocking or not shield_in_hand) and shield_in_offhand and rmb and offhand_can_block and not is_eating and mcl_shields.players[player].cooldown == 0 then player_shield.blocking = 1 set_shield(player, true, 1) else