1
This commit is contained in:
parent
7762d7974c
commit
3f0357a46c
@ -76,6 +76,10 @@ bool BaseAgent::PreEnterCoroutine(int co_id, behaviac::EBTStatus& status)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auto& co = itr->second;
|
auto& co = itr->second;
|
||||||
|
if (co->IsAbort()) {
|
||||||
|
status = behaviac::BT_FAILURE;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (co->status != behaviac::BT_RUNNING) {
|
if (co->status != behaviac::BT_RUNNING) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
@ -174,5 +178,8 @@ int BaseAgent::DeltaTime(int time)
|
|||||||
|
|
||||||
void BaseAgent::AbortCoroutine(int co_id)
|
void BaseAgent::AbortCoroutine(int co_id)
|
||||||
{
|
{
|
||||||
|
auto itr = coroutines_hash_.find(co_id);
|
||||||
|
if (itr != coroutines_hash_.end()) {
|
||||||
|
itr->second->Abort(GetRoom()->GetFrameNo());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include "mt/Equip.h"
|
#include "mt/Equip.h"
|
||||||
#include "mt/Skill.h"
|
#include "mt/Skill.h"
|
||||||
|
|
||||||
|
#include "behaviac_generated/types/internal/behaviac_customized_types.h"
|
||||||
|
|
||||||
HeroAgent::HeroAgent():BaseAgent()
|
HeroAgent::HeroAgent():BaseAgent()
|
||||||
{
|
{
|
||||||
current_target_agent = behaviac::Agent::Create<TargetAgent>();
|
current_target_agent = behaviac::Agent::Create<TargetAgent>();
|
||||||
@ -493,7 +495,7 @@ behaviac::EBTStatus HeroAgent::CoMoveMasterRaycast()
|
|||||||
|
|
||||||
behaviac::EBTStatus HeroAgent::CoFindPath(const glm::vec3& pos)
|
behaviac::EBTStatus HeroAgent::CoFindPath(const glm::vec3& pos)
|
||||||
{
|
{
|
||||||
PRE_ENTER_COROUTINE();
|
PRE_ENTER_COROUTINE_EX(kCoFindPath);
|
||||||
auto context = MAKE_BTCONTEXT
|
auto context = MAKE_BTCONTEXT
|
||||||
(
|
(
|
||||||
bool find_ok = false;
|
bool find_ok = false;
|
||||||
@ -527,7 +529,7 @@ behaviac::EBTStatus HeroAgent::CoFindPath(const glm::vec3& pos)
|
|||||||
|
|
||||||
behaviac::EBTStatus HeroAgent::CoFindPathEx(const glm::vec3& pos, float distance)
|
behaviac::EBTStatus HeroAgent::CoFindPathEx(const glm::vec3& pos, float distance)
|
||||||
{
|
{
|
||||||
PRE_ENTER_COROUTINE();
|
PRE_ENTER_COROUTINE_EX(kCoFindPathEx);
|
||||||
auto context = MAKE_BTCONTEXT
|
auto context = MAKE_BTCONTEXT
|
||||||
(
|
(
|
||||||
bool find_ok = false;
|
bool find_ok = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user