libgdx/gdx-ai — pull request #13 by florianbaethge (2014-10-07 13:38:38+00:00)
Title: LinePaths need to consist of at least two waypoints

Hi,

while working with the FollowPath behavior I noticed that when I only entered an open LinePath with a single waypoint, the app will crash with a NullPointerException in ```calculateDistance(...)```.

So I looked at the code and found out that a LinePath needs to consist of at least two waypoints. Having a single one only works for closed paths, but it would create two segments from and to the same waypoint.

On an open path, no ```Segment``` would be saved, ergo when calculating the distance, we would get a NullPointerexception, since ```nearestSegment``` never gets filled.

Also, IMHO it wouldn't make any sense to only have paths consisting of a single point, since there is nothing to move...

Good work on all this, though! It's awesome!