mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 08:29:34 +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
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue