Fix player taking damage when damage is disabled

This commit is contained in:
Wuzzy 2020-06-20 18:30:12 +02:00
parent df7da1787c
commit 15655e6929

View File

@ -141,6 +141,10 @@ function armor.get_groups(player)
groups.fleshy = groups.fleshy - 10
end
if minetest.settings:get_bool("enable_damage", true) == false then
groups.immortal = 1
end
return groups
end
@ -155,7 +159,7 @@ end
-- This function must be called whenever the armor inventory has been changed
function armor.update(player)
local groups = armor.get_groups(player)
player:set_armor_groups({fleshy = groups.fleshy})
player:set_armor_groups({fleshy = groups.fleshy, immortal = groups.immortal})
local image = armor.get_texture(player, armor.get_base_skin(player))
if image ~= default.player_get_textures(player)[1] then