This commit is contained in:
aozhiwei 2023-04-05 15:11:57 +08:00
parent cb5f01beff
commit 1eeb8300b4
3 changed files with 7 additions and 6 deletions

View File

@ -54,7 +54,7 @@ behaviac::EBTStatus AndroidAgent::DoRandomWalk()
kAttacked,
[context_wp = context->GetWp()] (const a8::Args& args)
{
if (context_wp.expired()) {
if (!context_wp.expired()) {
auto context = context_wp.lock();
Creature* c = args.Get<Creature*>(0);
context->last_attacker = c->GetWeakPtrRef();
@ -126,7 +126,7 @@ behaviac::EBTStatus AndroidAgent::DoRandomShot()
kAttacked,
[context_wp = context->GetWp()] (const a8::Args& args)
{
if (context_wp.expired()) {
if (!context_wp.expired()) {
auto context = context_wp.lock();
Creature* c = args.Get<Creature*>(0);
context->last_attacker = c->GetWeakPtrRef();
@ -252,7 +252,7 @@ behaviac::EBTStatus AndroidAgent::DoPursuit()
kAttacked,
[context_wp = context->GetWp()] (const a8::Args& args)
{
if (context_wp.expired()) {
if (!context_wp.expired()) {
auto context = context_wp.lock();
Creature* c = args.Get<Creature*>(0);
context->last_attacker = c->GetWeakPtrRef();

View File

@ -100,7 +100,7 @@ behaviac::EBTStatus BaseAgent::StartCoroutine(std::shared_ptr<BtCoroutine> corou
{
coroutine_ = coroutine;
#ifdef DEBUG
last_status_ = behaviac::BT_INVALID;
last_status_ = behaviac::BT_INVALID;d
status_frameno_ = GetOwner()->room->GetFrameNo();
status_name_ = coroutine_->name;
#endif
@ -270,3 +270,4 @@ behaviac::EBTStatus BaseAgent::DoIdle(int min_time, int max_time)
};
return StartCoroutine(co);
}
>

View File

@ -52,7 +52,7 @@ behaviac::EBTStatus HeroAgent::DoRandomWalk()
kAttacked,
[context_wp = context->GetWp()] (const a8::Args& args)
{
if (context_wp.expired()) {
if (!context_wp.expired()) {
auto context = context_wp.lock();
Creature* c = args.Get<Creature*>(0);
context->last_attacker = c->GetWeakPtrRef();
@ -124,7 +124,7 @@ behaviac::EBTStatus HeroAgent::DoRandomShot()
kAttacked,
[context_wp = context->GetWp()] (const a8::Args& args)
{
if (context_wp.expired()) {
if (!context_wp.expired()) {
auto context = context_wp.lock();
Creature* c = args.Get<Creature*>(0);
context->last_attacker = c->GetWeakPtrRef();