diff --git a/server/gameserver/skill.cc b/server/gameserver/skill.cc index ddc9c709..7abc7139 100644 --- a/server/gameserver/skill.cc +++ b/server/gameserver/skill.cc @@ -612,24 +612,39 @@ void Skill::Proc30601DJS() { a8::XTimerWp passive_skill_timer; { - auto context = A8_MAKE_ANON_STRUCT_SHARED( - int a = 0; - ); - auto in_human_infos = std::make_shared>>>(); - auto on_enter = - [this, in_human_infos] (Human* hum, const mt::Skill* active_skill_meta) + struct InnerObject + { + CreatureWeakPtr c; + + void OnEnter() { - if (in_human_infos->find(hum) != in_human_infos->end()) { + + } + + void OnLeave() + { + + } + + }; + auto context = A8_MAKE_ANON_STRUCT_SHARED + ( + std::map in_human_infos; + ); + auto on_enter = + [this, context] (Human* hum, const mt::Skill* active_skill_meta) + { + if (context->in_human_infos.find(hum->GetUniId()) != context->in_human_infos.end()) { abort(); } if (active_skill_meta) { hum->GetAbility()->AddSpeedRuduce(active_skill_meta->_number_meta->_float_speed); } - std::vector buff_list; - (*in_human_infos)[hum] = std::make_tuple(1, buff_list); + context->in_human_infos[hum->GetUniId()] = InnerObject(); + context->in_human_infos[hum->GetUniId()].OnEnter(); }; auto on_stay = - [this] (Human* hum, const mt::Skill* active_skill_meta) + [this, context] (Human* hum, const mt::Skill* active_skill_meta) { if (hum->GetHP() < hum->GetMaxHP()) { if (active_skill_meta) { @@ -641,15 +656,17 @@ void Skill::Proc30601DJS() } }; auto on_leave = - [this, in_human_infos] (Human* hum, const mt::Skill* active_skill_meta) + [this, context] (Human* hum, const mt::Skill* active_skill_meta) { - if (in_human_infos->find(hum) == in_human_infos->end()) { + auto itr = context->in_human_infos.find(hum->GetUniId()); + if (itr == context->in_human_infos.end()) { abort(); } if (active_skill_meta) { hum->GetAbility()->DelSpeedRuduce(active_skill_meta->_number_meta->_float_speed); } - in_human_infos->erase(hum); + itr->second.OnLeave(); + context->in_human_infos.erase(itr); }; auto check_cb = [this, on_enter, on_stay, on_leave] diff --git a/third_party/a8 b/third_party/a8 index e7505277..ee8724d5 160000 --- a/third_party/a8 +++ b/third_party/a8 @@ -1 +1 @@ -Subproject commit e7505277a1c15c785d6194dfee51e1dd2e6b84ec +Subproject commit ee8724d50b4487d8684b9ad47942c5e622ce93b8