This commit is contained in:
aozhiwei 2023-10-14 14:56:58 +08:00
parent 7f49358f6f
commit 3b89fc8991

View File

@ -32,7 +32,9 @@ HeroAgent::~HeroAgent()
void HeroAgent::Exec() void HeroAgent::Exec()
{ {
behaviac::EBTStatus status = f8::BtMgr::Instance()->BtExec(this); behaviac::EBTStatus status = f8::BtMgr::Instance()->BtExec(this);
if (status == behaviac::BT_RUNNING && coroutine_ && coroutine_->GetContext()->HasEvent()) { if (status == behaviac::BT_RUNNING &&
coroutine_ &&
coroutine_->GetContext()->HasEvent()) {
status_= behaviac::BT_INVALID; status_= behaviac::BT_INVALID;
auto old_coroutine = coroutine_; auto old_coroutine = coroutine_;
coroutine_ = nullptr; coroutine_ = nullptr;