修复挂bug

This commit is contained in:
aozhiwei 2020-06-06 19:55:47 +08:00
parent 856e4213f2
commit de5e50e09f

View File

@ -220,8 +220,14 @@ void AndroidAI::UpdateLastNpc()
} else if (hum->room->GetFrameNo() - hum->enable_frameno < SERVER_FRAME_RATE * 1.5) {
int speed = std::max(1, (int)hum->GetSpeed());
for (int i = 0; i < speed; ++i) {
a8::Vec2 old_pos = hum->GetPos();
hum->SetPos(hum->GetPos() + hum->move_dir);
hum->room->grid_service->MoveHuman(hum);
if (!hum->room->OverBorder(hum->GetPos(), hum->meta->i->radius())) {
hum->room->grid_service->MoveHuman(hum);
} else {
hum->SetPos(old_pos);
break;
}
}
} else if (hum->room->GetFrameNo() - hum->enable_frameno < SERVER_FRAME_RATE * 3) {
Human* enemy = hum->last_human_target;