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

@ -491,10 +491,13 @@ armor.set_player_armor = function(self, player)
armor_monoid.monoid:add_change(player, change, "3d_armor:armor") armor_monoid.monoid:add_change(player, change, "3d_armor:armor")
else else
-- Preserve immortal group (damage disabled for player) -- 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 if immortal and immortal ~= 0 then
groups.immortal = 1 groups.immortal = 1
end 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) player:set_armor_groups(groups)
end end
if use_player_monoids then if use_player_monoids then