1
This commit is contained in:
parent
ed4b8b09aa
commit
53d0553d40
@ -50,7 +50,7 @@ behaviac::EBTStatus AndroidAgent::DoRandomShot()
|
|||||||
GetOwner()->GetTrigger()->AddListener
|
GetOwner()->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kAttacked,
|
kAttacked,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = a8::SpToWp(context)] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (!context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
|
@ -54,7 +54,7 @@ behaviac::EBTStatus HeroAgent::DoAttack()
|
|||||||
GetOwner()->AsHero()->master.Get()->GetTrigger()->AddListener
|
GetOwner()->AsHero()->master.Get()->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kBulletHitEvent,
|
kBulletHitEvent,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = a8::SpToWp(context)] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (!context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
|
@ -37,7 +37,7 @@ behaviac::EBTStatus HeroAgent::DoRandomShot()
|
|||||||
GetOwner()->GetTrigger()->AddListener
|
GetOwner()->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kAttacked,
|
kAttacked,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = a8::SpToWp(context)] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (!context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
|
@ -36,7 +36,7 @@ behaviac::EBTStatus HeroAgent::DoRandomWalk()
|
|||||||
GetOwner()->GetTrigger()->AddListener
|
GetOwner()->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kAttacked,
|
kAttacked,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = a8::SpToWp(context)] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (!context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
|
@ -13,7 +13,6 @@ public:
|
|||||||
|
|
||||||
virtual ~BtContext();
|
virtual ~BtContext();
|
||||||
void AddHandler(CreatureWeakPtr target, std::weak_ptr<EventHandlerPtr> handler);
|
void AddHandler(CreatureWeakPtr target, std::weak_ptr<EventHandlerPtr> handler);
|
||||||
std::weak_ptr<BtContext> GetWp() { return shared_from_this();};
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user