Adventurer has been getting stuck a lot lately, especially on new maps but also on a few old ones, so I dove in and found that it doesn't really have any code to get unstuck. I copied a small bit of Trinity's unstuck code and modified it a little for Adventurer. The results have been amazing so far, the debug log shows it has gotten unstuck many times in just the last hour.
In Plugins/Adventurer/Coroutines/NavigationCoroutine.cs change this:
to this:
In Plugins/Adventurer/Coroutines/NavigationCoroutine.cs change this:
Code:
private NavigationCoroutine(Vector3 destination, int distance)
{
_destination = destination;
_distance = distance;
if (_distance < 2)
{
_distance = 2;
}
}
Code:
private NavigationCoroutine(Vector3 destination, int distance)
{
_destination = destination;
_distance = distance;
if (_distance < 2)
{
_distance = 2;
}
if (LastResult == CoroutineResult.Failure)
{
Logger.Debug("Trying RANDOM unstuck point!");
Random random = new Random();
_distance = random.Next(5, 30);
float direction = (float)random.NextDouble();
Vector3 myPos = AdvDia.MyPosition;
_destination = MathEx.GetPointAt(myPos, _distance, direction);
}
}