修复机器人行动宕机问题
This commit is contained in:
parent
4cb9c0649c
commit
bd10f32cb9
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user