This commit is contained in:
aozhiwei 2021-05-18 11:32:56 +08:00
parent b97746dd84
commit f669b63892

View File

@ -587,11 +587,17 @@ void AndroidNewAI::UpdateRandomWalk()
void AndroidNewAI::UpdatePursuit() void AndroidNewAI::UpdatePursuit()
{ {
Human* myself = (Human*)owner; Human* myself = (Human*)owner;
float distance = myself->GetPos().Distance(node_.target.Get()->GetPos()); if (node_.target.Get()) {
if (!myself->HasBuffEffect(kBET_Jump) && float distance = myself->GetPos().Distance(node_.target.Get()->GetPos());
!a8::HasBitFlag(myself->status, HS_DisableAttack) && if (!myself->HasBuffEffect(kBET_Jump) &&
distance < GetAttackRange()) { !a8::HasBitFlag(myself->status, HS_DisableAttack) &&
ChangeToStateNewAI(ASE_Attack); distance < GetAttackRange()) {
ChangeToStateNewAI(ASE_Attack);
} else {
if (node_.exec_frame_num > 100 * 2) {
ChangeToStateNewAI(ASE_RandomWalk);
}
}
} else { } else {
if (node_.exec_frame_num > 100 * 2) { if (node_.exec_frame_num > 100 * 2) {
ChangeToStateNewAI(ASE_RandomWalk); ChangeToStateNewAI(ASE_RandomWalk);