1
This commit is contained in:
parent
7974264f5d
commit
dc1ff597df
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user