1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2024-12-26 18:50:40 +01:00

Preserve fall_damage_add_percent when setting player armor (#81)

This commit is contained in:
EmptyStar 2022-09-07 16:01:18 -04:00 committed by GitHub
parent c7ee559a4c
commit eebee34fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -491,10 +491,13 @@ armor.set_player_armor = function(self, player)
armor_monoid.monoid:add_change(player, change, "3d_armor:armor")
else
-- Preserve immortal group (damage disabled for player)
local immortal = player:get_armor_groups().immortal
local player_groups = player:get_armor_groups()
local immortal = player_groups.immortal
if immortal and immortal ~= 0 then
groups.immortal = 1
end
-- Preserve fall_damage_add_percent group (fall damage modifier)
groups.fall_damage_add_percent = player_groups.fall_damage_add_percent
player:set_armor_groups(groups)
end
if use_player_monoids then