From bdc82b76b57e24e6b0d10df92c3ff460dec48d16 Mon Sep 17 00:00:00 2001 From: emptyshore Date: Wed, 1 Feb 2023 18:29:29 +1300 Subject: [PATCH] Respect immortal armor group, ensuring objects are not dealt damage Context: some objects such as chest, frame or sign entities are set to be immortal, because they are tied to a node and should not be removed on their own. However since immortality wasn't respected, it would lead to odd desync issues between nodes and accompanying entities. An example is a chest that becomes invisible when struck by lightning or anvil. --- mods/CORE/mcl_util/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index f37b34444..89ed4accf 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -556,6 +556,11 @@ function mcl_util.deal_damage(target, damage, mcl_reason) end end + local is_immortal = target:get_armor_groups().immortal or 0 + if is_immortal>0 then + return + end + local hp = target:get_hp() if hp > 0 then