VSZue / DonAINavigation

This plugin provides a 3D dynamic pathfinding system for use with Unreal Engine 4. It's primarly designed for Flying AI creatures based in dynamic or procedural worlds that need to solve complex pathfinding tasks.
MIT License
239 stars 113 forks source link

Moved callback for async path finish to after the task is fully cleaned up #14

Open OregonJunco opened 5 years ago

OregonJunco commented 5 years ago

Hi there! Thanks so much for making this plugin -- it's been really great to work in!

In the current version of DoN, calling SchedulePathfindingTask from the Result Handler Delegate of an earlier SchedulePathfindingTask throws an error because the callback is invoked before the task is fully cleaned up.

An example use case would be an actor that's iteratively querying paths to different targets in order to choose the best one to take. DoN only allows one active pathfinding task at a time, so this actor will need to schedule new tasks immediately as the old ones finish.

This case is tested to work after swapping these two lines of code!