diff --git a/server/gameserver/android.ai.cc b/server/gameserver/android.ai.cc index 912c5bf..4fc227f 100644 --- a/server/gameserver/android.ai.cc +++ b/server/gameserver/android.ai.cc @@ -164,8 +164,10 @@ void AndroidAI::UpdateNewBieNpc() { Human* hum = (Human*)owner; if (hum->room->GetFrameNo() - hum->enable_frameno < 2) { - hum->move_dir = hum->room->GetFirstNewBie()->GetPos() - hum->GetPos(); - hum->move_dir.Normalize(); + if (hum->GetPos().ManhattanDistance(hum->room->GetFirstNewBie()->GetPos()) > 100) { + hum->move_dir = hum->room->GetFirstNewBie()->GetPos() - hum->GetPos(); + hum->move_dir.Normalize(); + } hum->attack_dir = hum->move_dir; if (hum->curr_weapon->weapon_idx != 0) { hum->curr_weapon->ammo = MetaMgr::Instance()->newbie_first_robot_ammo; @@ -204,8 +206,10 @@ void AndroidAI::UpdateLastNpc() { Human* hum = (Human*)owner; if (hum->room->GetFrameNo() - hum->enable_frameno < 2) { - hum->move_dir = hum->last_human_target->GetPos() - hum->GetPos(); - hum->move_dir.Normalize(); + if (hum->GetPos().ManhattanDistance(hum->last_human_target->GetPos()) > 100) { + hum->move_dir = hum->last_human_target->GetPos() - hum->GetPos(); + hum->move_dir.Normalize(); + } hum->attack_dir = hum->move_dir; if (hum->curr_weapon->weapon_idx != 0) { hum->curr_weapon->ammo = MetaMgr::Instance()->newbie_first_robot_ammo * 2;