1
This commit is contained in:
parent
6efcec599a
commit
36cc1e758d
@ -315,8 +315,6 @@ behaviac::EBTStatus BaseAgent::DoIdle(int min_time, int max_time)
|
||||
auto context = MAKE_BTCONTEXT
|
||||
(
|
||||
a8::XTimerWp timer_ptr;
|
||||
CreatureWeakPtr last_attacker;
|
||||
long long last_attacked_frameno = 0;
|
||||
);
|
||||
context->timer_ptr = GetOwner()->room->xtimer.SetTimeoutWpEx
|
||||
(
|
||||
@ -333,8 +331,20 @@ behaviac::EBTStatus BaseAgent::DoIdle(int min_time, int max_time)
|
||||
if (!context_wp.expired()) {
|
||||
auto context = context_wp.lock();
|
||||
Creature* c = args.Get<Creature*>(0);
|
||||
context->last_attacker = c->GetWeakPtrRef();
|
||||
context->last_attacked_frameno = c->room->GetFrameNo();
|
||||
context->events.push_back
|
||||
(
|
||||
BtEvent::Create
|
||||
(
|
||||
kBetOnAttack,
|
||||
a8::Args({
|
||||
c->GetUniId(),
|
||||
kBetOnAttack
|
||||
}),
|
||||
[c_wp = c->GetWeakPtrRef(), frameno = c->room->GetFrameNo()] () mutable
|
||||
{
|
||||
return c_wp.Get() && !c_wp.Get()->dead;
|
||||
})
|
||||
);
|
||||
}
|
||||
}));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user