Commit bd760470 authored by louiz’'s avatar louiz’

Avoid an undefined behaviour when the path finding returned an empty path

parent ffabcfd0
......@@ -29,6 +29,9 @@ void Mobility::set_speed(const Fix16& speed)
void Mobility::follow_path(Path& path, World* world, Location* location)
{
if (path.empty())
return;
Position goal = path.front();
Vec2 movement(goal - location->position());
if (movement.length() == 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment