A* Pathfinding Project

Found a crash in RichPath (v.4.3.5)


#1

Hi!

I am using RecastGraph with some ammount of node links throught point graph. I also use RichAI for navigaton with Funnel Simplification on. So sometimes RichPath:SimplifyPath pass “(start == end)” condition because of different nodes at same positions and then result.Count == 0 and function crashes.

All I added was this check:

            float delta = Vector3.Distance(startPoint, endPoint);
            if (0.01f > delta)
            {
                result.Add(nodes[end]);
                return;
            }

for close nodes and it fixed this for me. I hope it will help others