修复14 Ai命中定身BUFF,实际仍可射击

This commit is contained in:
aozhiwei 2021-06-04 19:19:05 +08:00
parent 744507e9b3
commit 03612c3f73
2 changed files with 12 additions and 0 deletions

View File

@ -529,6 +529,9 @@ void AndroidNewAI::UpdateAttack()
return;
}
#endif
if (myself->HasBuffEffect(kBET_Vertigo)) {
return;
}
float distance = myself->GetPos().Distance(node_.target.Get()->GetPos());
if (distance > GetAttackRange()) {
if (ai_meta->i->pursuit_radius() <= 0) {
@ -608,6 +611,9 @@ void AndroidNewAI::UpdatePursuit()
void AndroidNewAI::DoMoveNewAI()
{
Human* hum = (Human*)owner;
if (hum->HasBuffEffect(kBET_Vertigo)) {
return;
}
if (std::abs(hum->GetMoveDir().x) > FLT_EPSILON ||
std::abs(hum->GetMoveDir().y) > FLT_EPSILON) {
hum->on_move_collision =

View File

@ -153,6 +153,9 @@ void HeroAI::UpdateAttack()
ChangeToStateAI(HSE_Thinking);
return;
}
if (myself->HasBuffEffect(kBET_Vertigo)) {
return;
}
float distance = myself->GetPos().Distance(node_.target.Get()->GetPos());
if (distance > GetAttackRange()) {
if (ai_meta->i->pursuit_radius() <= 0) {
@ -236,6 +239,9 @@ void HeroAI::UpdateFollowMaster()
void HeroAI::DoMoveAI()
{
Hero* hero = (Hero*)owner;
if (hero->HasBuffEffect(kBET_Vertigo)) {
return;
}
if (std::abs(hero->GetMoveDir().x) > FLT_EPSILON ||
std::abs(hero->GetMoveDir().y) > FLT_EPSILON) {
auto old_on_move_collision_func = hero->on_move_collision;