This commit is contained in:
aozhiwei 2023-06-29 16:53:49 +08:00
parent 7974264f5d
commit dc1ff597df

View File

@ -475,7 +475,19 @@ behaviac::EBTStatus BaseAgent::CoRunGas()
if (status_ == behaviac::BT_RUNNING) { if (status_ == behaviac::BT_RUNNING) {
return DoRunningCb(); return DoRunningCb();
} }
return behaviac::BT_FAILURE; if (GetSafeAreaRadius() < 200) {
return behaviac::BT_SUCCESS;
}
auto context = MAKE_BTCONTEXT
(
);
auto co = std::make_shared<BtCoroutine>(context, "CoRunGas");
co->runing_cb =
[this, context] ()
{
return behaviac::BT_RUNNING;
};
return StartCoroutine(co);
} }
float BaseAgent::GetSafeAreaRadius() float BaseAgent::GetSafeAreaRadius()