1
This commit is contained in:
parent
bb98564775
commit
23dc1d4548
@ -255,6 +255,7 @@ void Guide::ProcUseSkillAndKillEnemy()
|
|||||||
auto context = A8_MAKE_ANON_STRUCT_SHARED
|
auto context = A8_MAKE_ANON_STRUCT_SHARED
|
||||||
(
|
(
|
||||||
std::vector<int> heros;
|
std::vector<int> heros;
|
||||||
|
std::vector<std::weak_ptr<EventHandlerPtr>> handlers;
|
||||||
);
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -321,6 +322,20 @@ void Guide::ProcUseSkillAndKillEnemy()
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
&owner_->xtimer_attacher);
|
&owner_->xtimer_attacher);
|
||||||
|
|
||||||
|
context->handlers.push_back
|
||||||
|
(owner_->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kUseSkillEvent,
|
||||||
|
[this, context] (const a8::Args& args) mutable
|
||||||
|
{
|
||||||
|
Skill* skill = args.Get<Skill*>(0);
|
||||||
|
if (curr_step_meta_->_int_param1 == skill->meta->skill_id()) {
|
||||||
|
NextStep();
|
||||||
|
owner_->GetTrigger()->RemoveEventHandlers(context->handlers);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guide::ProcUseSkill()
|
void Guide::ProcUseSkill()
|
||||||
@ -338,8 +353,8 @@ void Guide::ProcUseSkill()
|
|||||||
{
|
{
|
||||||
Skill* skill = args.Get<Skill*>(0);
|
Skill* skill = args.Get<Skill*>(0);
|
||||||
if (curr_step_meta_->_int_param1 == skill->meta->skill_id()) {
|
if (curr_step_meta_->_int_param1 == skill->meta->skill_id()) {
|
||||||
owner_->GetTrigger()->RemoveEventHandlers(context->handlers);
|
|
||||||
NextStep();
|
NextStep();
|
||||||
|
owner_->GetTrigger()->RemoveEventHandlers(context->handlers);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user