优化机器人移动
This commit is contained in:
parent
ccdb5db5c4
commit
d2b68f3fea
@ -99,10 +99,10 @@ void AndroidAI::DoMove()
|
|||||||
for (int i = 0; i < speed; ++i) {
|
for (int i = 0; i < speed; ++i) {
|
||||||
a8::Vec2 old_pos = hum->pos;
|
a8::Vec2 old_pos = hum->pos;
|
||||||
hum->pos = hum->pos + hum->move_dir;
|
hum->pos = hum->pos + hum->move_dir;
|
||||||
if (hum->IsCollision()) {
|
if (hum->IsCollisionInMapService()) {
|
||||||
hum->pos = old_pos;
|
hum->pos = old_pos;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
hum->FindPath();
|
hum->FindPathInMapService();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user