muffin v7.5.2

This commit is contained in:
alydev 2026-05-02 10:19:05 +10:00
parent 965a736f84
commit 41e27710e2
3 changed files with 743 additions and 775 deletions

View file

@ -139,11 +139,11 @@ internal sealed class MovementController : IDisposable
get
{
Task<List<Vector3>> pathfindTask = _pathfindTask;
if (pathfindTask == null || pathfindTask.IsCompleted)
if (pathfindTask != null)
{
return _navmeshIpc.IsSimpleMovePathfindInProgress;
return !pathfindTask.IsCompleted;
}
return true;
return false;
}
}
@ -473,20 +473,34 @@ internal sealed class MovementController : IDisposable
to = vector;
}
PrepareNavigation(type, dataId, to, fly, sprint, stopDistance, verticalStopDistance ?? 1.95f, land, useNavmesh: true);
_logger.LogInformation("Pathfinding to {Destination} via SimpleMove", Destination);
_logger.LogInformation("Pathfinding to {Destination}", Destination);
Destination.NavmeshCalculations++;
float range = stopDistance ?? 2.8f;
if (!_navmeshIpc.SimplePathfindAndMoveCloseTo(to, fly, range))
_cancellationTokenSource = new CancellationTokenSource();
_cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(30L));
Vector3 vector2 = _objectTable[0]?.Position ?? Vector3.Zero;
if (fly && _aetheryteData.CalculateDistance(vector2, _clientState.TerritoryType, EAetheryteLocation.CoerthasCentralHighlandsCampDragonhead) < 11f)
{
_logger.LogWarning("SimpleMove rejected pathfind request (already in progress), stopping first");
_navmeshIpc.Stop();
if (!_navmeshIpc.SimplePathfindAndMoveCloseTo(to, fly, range))
{
_logger.LogWarning("SimpleMove still rejected after stop");
}
Vector3 vector = vector2;
vector.Y = vector2.Y + 1f;
vector2 = vector;
_logger.LogInformation("Using modified start position for flying pathfinding: {StartPosition}", vector2.ToString("G", CultureInfo.InvariantCulture));
}
else if (fly)
{
Vector3 vector = vector2;
vector.Y = vector2.Y + 0.2f;
vector2 = vector;
}
_pathfindStartTime = Environment.TickCount64;
if (fly && land)
{
_logger.LogInformation("Using tolerance-based pathfinding for landing (tolerance: 5.0)");
_pathfindTask = _navmeshIpc.PathfindWithTolerance(vector2, to, fly, 5f, _cancellationTokenSource.Token);
}
else
{
_pathfindTask = _navmeshIpc.Pathfind(vector2, to, fly, _cancellationTokenSource.Token);
}
MovementStartedAt = DateTime.Now;
StartPlayerInputTracking();
}
public void NavigateTo(EMovementType type, uint? dataId, List<Vector3> to, bool fly, bool sprint, float? stopDistance, float? verticalStopDistance = null, bool land = false)