1
This commit is contained in:
parent
ed9dbc7f55
commit
99441c3bae
@ -357,24 +357,12 @@ behaviac::EBTStatus HeroAgent::CoMoveCurrentTargetRaycast()
|
|||||||
}
|
}
|
||||||
auto context = MAKE_BTCONTEXT
|
auto context = MAKE_BTCONTEXT
|
||||||
(
|
(
|
||||||
a8::XTimerWp timer_ptr;
|
|
||||||
);
|
);
|
||||||
context->timer_ptr = owner_->room->xtimer.SetTimeoutWpEx
|
|
||||||
(
|
|
||||||
1000 / FRAME_RATE_MS,
|
|
||||||
[] (int event, const a8::Args* args)
|
|
||||||
{
|
|
||||||
},
|
|
||||||
&owner_->xtimer_attacher);
|
|
||||||
auto co = std::make_shared<BtCoroutine>(context, "CoMoveCurrentTargetRaycast");
|
auto co = std::make_shared<BtCoroutine>(context, "CoMoveCurrentTargetRaycast");
|
||||||
co->runing_cb =
|
co->runing_cb =
|
||||||
[this, context] ()
|
[this, context] ()
|
||||||
{
|
{
|
||||||
if (!context->timer_ptr.expired()) {
|
return behaviac::BT_SUCCESS;
|
||||||
return behaviac::BT_RUNNING;
|
|
||||||
} else {
|
|
||||||
return behaviac::BT_SUCCESS;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
return StartCoroutine(co);
|
return StartCoroutine(co);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user