From c117cf46cf821a49442d5eb36ebdabc28c2d7f8f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 5 Apr 2023 19:11:16 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 43d2ab10..86c9d4a2 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -281,7 +281,8 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in SyncAroundPlayers(__FILE__, __LINE__, __func__); } else { if (HasNoDownedTeammate() && !room->IsPveRoom()) { - SetHP(mt::Param::GetIntParam("downed_recover_hp")); + SetHP(GetMaxHP() * + std::min(1.0f, (float)mt::Param::GetFloatParam("downed_recover_hp"))); downed = true; if (HasBuffEffect(kBET_Camouflage)) { RemoveBuffByEffectId(kBET_Camouflage); @@ -315,7 +316,8 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in return; } float dmg_out = 0.0f; - int dec_hp = mt::Param::GetIntParam("downed_dec_hp"); + int dec_hp = GetMaxHP() * + std::min(1.0f, (float)mt::Param::GetFloatParam("downed_dec_hp")); DecHP(dec_hp, info->killer_id, info->killer_name, info->weapon_id, info->real_killer_id, info->real_killer_name, dmg_out);