From 01cd69f6407da7b6a4c02e6177afa9983bdb4499 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Sat, 16 Nov 2024 23:38:44 -0500 Subject: [PATCH] fix prior --- quant.ew/files/system/local_health/local_health.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quant.ew/files/system/local_health/local_health.lua b/quant.ew/files/system/local_health/local_health.lua index 8329705b..4145aac7 100644 --- a/quant.ew/files/system/local_health/local_health.lua +++ b/quant.ew/files/system/local_health/local_health.lua @@ -225,6 +225,7 @@ local function player_died() remove_inventory() local perk_data = perk_fns.get_my_perks() local _, max_hp = util.get_ent_health(ctx.my_player.entity) + local cap = util.get_ent_health_cap(ctx.my_player.entity) -- This may look like a hack, but it allows to use existing poly machinery to change player entity AND to store the original player for later, -- Which is, like, perfect. @@ -246,6 +247,7 @@ local function player_died() do_switch_effect(false) EntitySetName(ctx.my_player.entity, ctx.my_id.."?") util.set_ent_health(ctx.my_player.entity, {max_hp, max_hp}) + util.set_ent_health_cap(ctx.my_player.entity, cap) local iron = LoadGameEffectEntityTo(ctx.my_player.entity, "mods/quant.ew/files/system/local_health/notplayer/iron_stomach.xml") EntityAddTag(iron, "kill_on_revive") LoadGameEffectEntityTo(ctx.my_player.entity, "mods/quant.ew/files/system/spectate/no_tinker.xml") @@ -281,8 +283,8 @@ local function player_died() inventory_helper.set_item_data(item_data, ctx.my_player) remove_inventory_tags() perk_fns.update_perks_for_entity(perk_data, ctx.my_player.entity, allow_notplayer_perk) - util.set_ent_health_cap(ctx.my_player.entity, max_hp) util.set_ent_health(ctx.my_player.entity, {max_hp, max_hp}) + util.set_ent_health_cap(ctx.my_player.entity, cap) rpc.add_nickname_change_cursor() end