调整机器人速度为正常速度

This commit is contained in:
aozhiwei 2020-07-15 17:20:08 +08:00
parent 2f7c124e1c
commit 1e9b30b8d1
2 changed files with 11 additions and 13 deletions

View File

@ -566,18 +566,16 @@ void AndroidNewAI::UpdatePursuit()
void AndroidNewAI::DoMoveNewAI()
{
Human* hum = (Human*)owner;
if (hum->UpdatedTimes() % 2 == 0) {
if (std::abs(hum->move_dir.x) > FLT_EPSILON ||
std::abs(hum->move_dir.y) > FLT_EPSILON) {
hum->on_move_collision =
[this] () {
ChangeToStateNewAI(ASE_RandomWalk);
return false;
};
int speed = std::max(1, (int)hum->GetSpeed());
hum->_UpdateMove(speed);
hum->on_move_collision = nullptr;
}
if (std::abs(hum->move_dir.x) > FLT_EPSILON ||
std::abs(hum->move_dir.y) > FLT_EPSILON) {
hum->on_move_collision =
[this] () {
ChangeToStateNewAI(ASE_RandomWalk);
return false;
};
int speed = std::max(1, (int)hum->GetSpeed());
hum->_UpdateMove(speed);
hum->on_move_collision = nullptr;
}
}

View File

@ -2914,7 +2914,7 @@ void Room::InitAndroidAI()
for (Android* hum : androids) {
#ifdef DEBUG
#if 0
hum->SetAiLevel(3);
hum->SetAiLevel(7);
continue;
#endif
#endif