From 15655e6929b6f4463245ca342356287be5d550b5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 20 Jun 2020 18:30:12 +0200 Subject: [PATCH] Fix player taking damage when damage is disabled --- mods/armor/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/armor/init.lua b/mods/armor/init.lua index d1ca27a..8553ea2 100644 --- a/mods/armor/init.lua +++ b/mods/armor/init.lua @@ -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