This commit is contained in:
aozhiwei 2023-10-17 10:46:39 +08:00
parent 9a3d21800f
commit ec2f95677f

View File

@ -499,8 +499,11 @@ behaviac::EBTStatus HeroAgent::CoStartMove(float distance)
);
auto co = std::make_shared<BtCoroutine>(context, "CoStartMove");
co->runing_cb =
[this, context] ()
[this, context, distance] ()
{
if (!owner_->dead) {
owner_->GetMovement()->CalcTargetPos(distance);
}
return behaviac::BT_SUCCESS;
};
return StartCoroutine(co);