muffin v7.5.12
This commit is contained in:
parent
3102923ce2
commit
911ed68baa
65 changed files with 2356 additions and 1539 deletions
|
|
@ -2,6 +2,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Questionable.Controller.CustomDelivery;
|
||||
using Questionable.Controller.Steps;
|
||||
using Questionable.Controller.Steps.Common;
|
||||
using Questionable.Controller.Steps.Movement;
|
||||
|
|
@ -40,28 +41,32 @@ internal sealed class SmartNavReRouteService(ReRoutePolicy reRoutePolicy, SmartN
|
|||
}
|
||||
}
|
||||
List<ITask> list = ExtractNonMovementTasks(taskQueue);
|
||||
if (taskQueue.CurrentTaskExecutor?.CurrentTask is DeliveryNpcApproachTask item)
|
||||
{
|
||||
list.Insert(0, item);
|
||||
}
|
||||
ReRouteDecision reRouteDecision = reRoutePolicy.HandleMovementFailure(failedTargetNodeId, failedApproachNodeId, list.Count > 0);
|
||||
if (!(reRouteDecision is ReRouteDecision.SkipMovement))
|
||||
{
|
||||
if (reRouteDecision is ReRouteDecision.Replan replan)
|
||||
{
|
||||
taskQueue.Reset();
|
||||
foreach (ITask item in taskMapper.MapInstructions(replan.Instructions))
|
||||
{
|
||||
taskQueue.Enqueue(item);
|
||||
}
|
||||
foreach (ITask item2 in list)
|
||||
foreach (ITask item2 in taskMapper.MapInstructions(replan.Instructions))
|
||||
{
|
||||
taskQueue.Enqueue(item2);
|
||||
}
|
||||
foreach (ITask item3 in list)
|
||||
{
|
||||
taskQueue.Enqueue(item3);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
taskQueue.Reset();
|
||||
foreach (ITask item3 in list)
|
||||
foreach (ITask item4 in list)
|
||||
{
|
||||
taskQueue.Enqueue(item3);
|
||||
taskQueue.Enqueue(item4);
|
||||
}
|
||||
logger.LogInformation("Re-route: skipping movement with {TaskCount} preserved tasks", list.Count);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ internal sealed class SmartNavRouteEnqueuer(NavRouter navRouter, PlayerNavStateB
|
|||
{
|
||||
taskQueue.Enqueue(item);
|
||||
}
|
||||
reRouteService.ClearDestination();
|
||||
reRouteService.SetDestination(territoryId, position);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -156,4 +156,9 @@ internal sealed class SmartNavRouteEnqueuer(NavRouter navRouter, PlayerNavStateB
|
|||
{
|
||||
reRouteService.ClearDestination();
|
||||
}
|
||||
|
||||
public void SetDestination(uint territoryId, Vector3 position)
|
||||
{
|
||||
reRouteService.SetDestination(territoryId, position);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue