From 6ea187f7ee6e463648314335b802802e88ffe294 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 25 Sep 2023 13:40:29 +0800 Subject: [PATCH] 1 --- server/gameserver/netdata.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/gameserver/netdata.cc b/server/gameserver/netdata.cc index 8609ac0e..73b5031e 100644 --- a/server/gameserver/netdata.cc +++ b/server/gameserver/netdata.cc @@ -51,6 +51,7 @@ public: std::shared_ptr hero_dto; int spec_skill_id = 0; int main_skill_id = 0; + const mt::NpcStandard* standard_meta = nullptr; float GetHP() { @@ -155,7 +156,6 @@ private: #endif } } else { - const mt::NpcStandard* standard_meta = nullptr; auto match_conf = c->room->GetRankMatchConf(); if (match_conf) { standard_meta = mt::NpcStandard::GetByHeroAndLv @@ -1126,6 +1126,9 @@ float BattleDataContext::GetRecoverHpAdd() int BattleDataContext::GetHeroLevel() { + if (!owner_.Get()->IsPlayer() && hero_ability_ && hero_ability_->standard_meta) { + return hero_ability_->standard_meta->level(); + } return std::max(hero_lv_, 1); }