This commit is contained in:
aozhiwei 2019-03-20 18:59:58 +08:00
parent b99e46de42
commit f161f2b744

View File

@ -86,8 +86,11 @@ void AndroidAI::DoMove()
float distance = 8.0f + rand() % 10;
Vector2D out_pos;
if (owner->room->RandomPos((Human*)owner, distance, out_pos)) {
owner->movement->ClearPath();
owner->movement->AddPathPoint(out_pos, distance, owner->GetSpeed());
Human* hum = (Human*)owner;
hum->movement->ClearPath();
hum->movement->AddPathPoint(out_pos, distance, owner->GetSpeed());
hum->attack_dir = out_pos - owner->pos;
hum->attack_dir.Normalize();
}
}
}