1
This commit is contained in:
parent
0df5dc6b4c
commit
18fe92b789
@ -77,7 +77,10 @@ bool BaseAgent::PreEnterCoroutine(int co_id, behaviac::EBTStatus& status)
|
||||
}
|
||||
auto& co = itr->second;
|
||||
if (co->status != behaviac::BT_RUNNING) {
|
||||
#ifdef DEBUG
|
||||
abort();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
co->status = co->runing_cb(co.get());
|
||||
status = co->status;
|
||||
@ -182,6 +185,9 @@ void BaseAgent::AbortCoroutine(int co_id)
|
||||
{
|
||||
auto itr = coroutines_hash_.find(co_id);
|
||||
if (itr != coroutines_hash_.end()) {
|
||||
itr->second->Abort(GetRoom()->GetFrameNo());
|
||||
if (!itr->second->IsAbort()) {
|
||||
itr->second->Abort(GetRoom()->GetFrameNo());
|
||||
itr->second->runing_cb(itr->second.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -522,6 +522,7 @@ behaviac::EBTStatus HeroAgent::CoFindPath(const glm::vec3& pos)
|
||||
[this, context, pos] (BtCoroutine* co)
|
||||
{
|
||||
if (co->IsAbort()) {
|
||||
owner_->GetMovement()->ClearPath();
|
||||
return behaviac::BT_FAILURE;
|
||||
}
|
||||
if (owner_->dead) {
|
||||
@ -559,6 +560,7 @@ behaviac::EBTStatus HeroAgent::CoFindPathEx(const glm::vec3& pos, float distance
|
||||
[this, context, distance] (BtCoroutine* co)
|
||||
{
|
||||
if (co->IsAbort()) {
|
||||
owner_->GetMovement()->ClearPath();
|
||||
return behaviac::BT_FAILURE;
|
||||
}
|
||||
if (owner_->dead) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user