From a76e7cf2ea6a4f9202b6882632a325125fb4ca84 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 14 Apr 2023 11:00:15 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 5e4a1398..28d4f8c7 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -2243,13 +2243,16 @@ void Human::OnBulletHit(IBullet* bullet) Hero* hero = (Hero*)bullet->GetSender().Get(); if (hero->GetAbility()->GetSwitchTimes(kEnableDmgForwardTimes) > 0 && hero->master.Get() && - !hero->master.Get()->dead && - hero->master.Get()->GetBattleContext()->GetBrainLifePct() > 0.0f){ - float recover_hp = dmg_out * - hero->master.Get()->GetBattleContext()->GetBrainLifePct(); - if (recover_hp > 0.0f) { - hero->master.Get()->AddHp(recover_hp); + !hero->master.Get()->dead + ){ + if (hero->master.Get()->GetBattleContext()->GetBrainLifePct() > 0.0f) { + float recover_hp = dmg_out * + hero->master.Get()->GetBattleContext()->GetBrainLifePct(); + if (recover_hp > 0.0f) { + hero->master.Get()->AddHp(recover_hp); + } } + hero->master.Get()->GetTrigger()->DmgOut(this, dmg_out); } } }