This commit is contained in:
aozhiwei 2020-07-15 13:22:05 +08:00
parent 15816af295
commit a941fa538c
2 changed files with 6 additions and 1 deletions

View File

@ -561,6 +561,10 @@ void AndroidNewAI::DoMoveNewAI()
if (hum->UpdatedTimes() % 2 == 0) {
if (std::abs(hum->move_dir.x) > FLT_EPSILON ||
std::abs(hum->move_dir.y) > FLT_EPSILON) {
#if 1
int speed = std::max(1, (int)hum->GetSpeed());
hum->_UpdateMove(speed);
#else
int speed = std::max(1, (int)hum->GetSpeed());
for (int i = 0; i < speed; ++i) {
a8::Vec2 old_pos = hum->GetPos();
@ -574,6 +578,7 @@ void AndroidNewAI::DoMoveNewAI()
}
hum->room->grid_service->MoveHuman(hum);
}
#endif
}
}
}

View File

@ -275,9 +275,9 @@ class Human : public MoveableEntity
Entity* GetLastCollisionDoor() { return last_collision_door_; }
void SetLastCollisionDoor(Entity* door) { last_collision_door_ = door; }
ObjectSyncFlags* GetObjectSyncFlags(int obj_uniid);
void _UpdateMove(int speed);
protected:
void _UpdateMove(int speed);
void _InternalUpdateMove(float speed);
void ProcLootOldSkin(Loot* entity, MetaData::Equip* item_meta);
void ProcLootSkin(Loot* entity, MetaData::Equip* item_meta);