1
This commit is contained in:
parent
18fe92b789
commit
1609fc8055
@ -48,7 +48,7 @@
|
||||
</node>
|
||||
<node class="ReferencedBehavior" id="2">
|
||||
<property ReferenceBehavior="const string "task/MobaMode"" />
|
||||
<property Task="Self.HeroAgent::MobaMode(0,0)" />
|
||||
<property Task="Self.HeroAgent::MobaMode(0,0,{x=0;y=0;z=0;})" />
|
||||
</node>
|
||||
<node class="ReferencedBehavior" id="3">
|
||||
<property ReferenceBehavior="const string "task/ChiJiMode"" />
|
||||
|
@ -5,12 +5,13 @@
|
||||
<pars>
|
||||
<par name="_$local_task_param_$_0" type="int" value="0" />
|
||||
<par name="_$local_task_param_$_1" type="int" value="0" />
|
||||
<par name="_$local_task_param_$_2" type="glm::vec3" value="{x=0;y=0;z=0;}" />
|
||||
</pars>
|
||||
<node class="Task" id="0">
|
||||
<property Prototype="Self.HeroAgent::MobaMode(0,0)" />
|
||||
<property IsHTN="false" />
|
||||
<node class="IfElse" id="1">
|
||||
<node class="True" id="2" />
|
||||
<node class="False" id="2" />
|
||||
<node class="Noop" id="3" />
|
||||
<node class="IfElse" id="6">
|
||||
<node class="Condition" id="7">
|
||||
@ -34,7 +35,7 @@
|
||||
<property Opr="Self.BaseAgent::GetTickCount()" />
|
||||
</node>
|
||||
<node class="Parallel" id="9">
|
||||
<property ChildFinishPolicy="CHILDFINISH_LOOP" />
|
||||
<property ChildFinishPolicy="CHILDFINISH_ONCE" />
|
||||
<property ExitPolicy="EXIT_NONE" />
|
||||
<property FailurePolicy="FAIL_ON_ONE" />
|
||||
<property SuccessPolicy="SUCCEED_ON_ONE" />
|
||||
@ -64,7 +65,7 @@
|
||||
<property Operator="Equal" />
|
||||
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
|
||||
<property Opr2="const int 0" />
|
||||
<property Phase="Enter" />
|
||||
<property Phase="Both" />
|
||||
</attachment>
|
||||
<node class="Sequence" id="16">
|
||||
<node class="IfElse" id="15">
|
||||
|
@ -77,10 +77,12 @@ 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;
|
||||
}
|
||||
if (co->IsAbort()) {
|
||||
list_del_init(&co->entry);
|
||||
coroutines_hash_.erase(itr);
|
||||
return false;
|
||||
}
|
||||
co->status = co->runing_cb(co.get());
|
||||
status = co->status;
|
||||
@ -94,6 +96,7 @@ bool BaseAgent::PreEnterCoroutine(int co_id, behaviac::EBTStatus& status)
|
||||
void BaseAgent::CheckCoroutineEvent()
|
||||
{
|
||||
int co_id = -1;
|
||||
bool has_abort_co = false;
|
||||
{
|
||||
list_head* pos = nullptr;
|
||||
list_head* next = nullptr;
|
||||
@ -188,6 +191,9 @@ void BaseAgent::AbortCoroutine(int co_id)
|
||||
if (!itr->second->IsAbort()) {
|
||||
itr->second->Abort(GetRoom()->GetFrameNo());
|
||||
itr->second->runing_cb(itr->second.get());
|
||||
itr->second->runing_cb = nullptr;
|
||||
list_del_init(&itr->second->entry);
|
||||
coroutines_hash_.erase(itr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ class BtCoroutine
|
||||
long long sleep_end_frameno = 0;
|
||||
int sleep_time = 0;
|
||||
list_head entry;
|
||||
long long abort_exec_times = 0;
|
||||
long long abort_frameno = 0;
|
||||
behaviac::EBTStatus status = behaviac::BT_RUNNING;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user