调整机器人速度为正常速度
This commit is contained in:
parent
2f7c124e1c
commit
1e9b30b8d1
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2914,7 +2914,7 @@ void Room::InitAndroidAI()
|
||||
for (Android* hum : androids) {
|
||||
#ifdef DEBUG
|
||||
#if 0
|
||||
hum->SetAiLevel(3);
|
||||
hum->SetAiLevel(7);
|
||||
continue;
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user