This commit is contained in:
aozhiwei 2019-06-28 16:02:29 +08:00
parent 725e992797
commit 7762e30be5

View File

@ -774,8 +774,10 @@ void Room::FindLocationWithAabb(Entity* target, const a8::Vec2& aabb_pos, AabbCo
a8::Vec2 new_pos_dir = new_pos - old_pos;
new_pos_dir.Normalize();
float distance = (new_pos - old_pos).Norm();
for (int i = distance; i < 10000000; i += 5) {
for (int i = distance; i < 100000; i += 5) {
a8::Vec2 pos = old_pos + new_pos_dir * i;
new_x = pos.x;
new_y = pos.y;
Entity* building = nullptr;
std::set<GridCell*> new_grid_list;