From f2812826d30d35c6fca56e5c3c49587a86fb8879 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 15 Feb 2023 19:54:47 +0800 Subject: [PATCH] 1 --- server/gameserver/skill.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/server/gameserver/skill.cc b/server/gameserver/skill.cc index 15d9268f..beff8706 100644 --- a/server/gameserver/skill.cc +++ b/server/gameserver/skill.cc @@ -630,12 +630,18 @@ void Skill::Proc30601DJS() { a8::XTimerWp passive_skill_timer; { + auto in_human_infos = std::make_shared>>>(); auto on_enter = - [this] (Human* num, const mt::Skill* active_skill_meta) + [this, in_human_infos] (Human* hum, const mt::Skill* active_skill_meta) { + if (in_human_infos->find(hum) != in_human_infos->end()) { + abort(); + } if (active_skill_meta) { owner->GetAbility()->AddSpeedRuduce(active_skill_meta->_number_meta->_float_speed); } + std::vector buff_list; + (*in_human_infos)[hum] = std::make_tuple(1, buff_list); }; auto on_stay = [this] (Human* hum, const mt::Skill* active_skill_meta) @@ -643,11 +649,15 @@ void Skill::Proc30601DJS() }; auto on_leave = - [this] (Human* hum, const mt::Skill* active_skill_meta) + [this, in_human_infos] (Human* hum, const mt::Skill* active_skill_meta) { + if (in_human_infos->find(hum) == in_human_infos->end()) { + abort(); + } if (active_skill_meta) { owner->GetAbility()->DelSpeedRuduce(active_skill_meta->_number_meta->_float_speed); } + in_human_infos->erase(hum); }; auto check_cb = [this, on_enter, on_stay, on_leave] @@ -662,7 +672,7 @@ void Skill::Proc30601DJS() ( [this, range, hit_humans, &size] (Human* hum) mutable { - if (owner != hum && + if (owner != hum && !hum->dead && Collision::CheckCC(owner, owner->GetRadius(), hum, range)) { if (size < MAX_TEAM_NUM) {