1
This commit is contained in:
parent
cb5f01beff
commit
1eeb8300b4
@ -54,7 +54,7 @@ behaviac::EBTStatus AndroidAgent::DoRandomWalk()
|
|||||||
kAttacked,
|
kAttacked,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = context->GetWp()] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
Creature* c = args.Get<Creature*>(0);
|
Creature* c = args.Get<Creature*>(0);
|
||||||
context->last_attacker = c->GetWeakPtrRef();
|
context->last_attacker = c->GetWeakPtrRef();
|
||||||
@ -126,7 +126,7 @@ behaviac::EBTStatus AndroidAgent::DoRandomShot()
|
|||||||
kAttacked,
|
kAttacked,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = context->GetWp()] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
Creature* c = args.Get<Creature*>(0);
|
Creature* c = args.Get<Creature*>(0);
|
||||||
context->last_attacker = c->GetWeakPtrRef();
|
context->last_attacker = c->GetWeakPtrRef();
|
||||||
@ -252,7 +252,7 @@ behaviac::EBTStatus AndroidAgent::DoPursuit()
|
|||||||
kAttacked,
|
kAttacked,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = context->GetWp()] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
Creature* c = args.Get<Creature*>(0);
|
Creature* c = args.Get<Creature*>(0);
|
||||||
context->last_attacker = c->GetWeakPtrRef();
|
context->last_attacker = c->GetWeakPtrRef();
|
||||||
|
@ -100,7 +100,7 @@ behaviac::EBTStatus BaseAgent::StartCoroutine(std::shared_ptr<BtCoroutine> corou
|
|||||||
{
|
{
|
||||||
coroutine_ = coroutine;
|
coroutine_ = coroutine;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
last_status_ = behaviac::BT_INVALID;
|
last_status_ = behaviac::BT_INVALID;d
|
||||||
status_frameno_ = GetOwner()->room->GetFrameNo();
|
status_frameno_ = GetOwner()->room->GetFrameNo();
|
||||||
status_name_ = coroutine_->name;
|
status_name_ = coroutine_->name;
|
||||||
#endif
|
#endif
|
||||||
@ -270,3 +270,4 @@ behaviac::EBTStatus BaseAgent::DoIdle(int min_time, int max_time)
|
|||||||
};
|
};
|
||||||
return StartCoroutine(co);
|
return StartCoroutine(co);
|
||||||
}
|
}
|
||||||
|
>
|
||||||
|
@ -52,7 +52,7 @@ behaviac::EBTStatus HeroAgent::DoRandomWalk()
|
|||||||
kAttacked,
|
kAttacked,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = context->GetWp()] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
Creature* c = args.Get<Creature*>(0);
|
Creature* c = args.Get<Creature*>(0);
|
||||||
context->last_attacker = c->GetWeakPtrRef();
|
context->last_attacker = c->GetWeakPtrRef();
|
||||||
@ -124,7 +124,7 @@ behaviac::EBTStatus HeroAgent::DoRandomShot()
|
|||||||
kAttacked,
|
kAttacked,
|
||||||
[context_wp = context->GetWp()] (const a8::Args& args)
|
[context_wp = context->GetWp()] (const a8::Args& args)
|
||||||
{
|
{
|
||||||
if (context_wp.expired()) {
|
if (!context_wp.expired()) {
|
||||||
auto context = context_wp.lock();
|
auto context = context_wp.lock();
|
||||||
Creature* c = args.Get<Creature*>(0);
|
Creature* c = args.Get<Creature*>(0);
|
||||||
context->last_attacker = c->GetWeakPtrRef();
|
context->last_attacker = c->GetWeakPtrRef();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user