mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 05:43:43 +01:00
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.
This commit is contained in:
parent
6f67f0e095
commit
bdc82b76b5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user