1
0
forked from liza/Questionable

Fix stopDistance for WalkTo steps

This commit is contained in:
Liza 2024-07-16 20:41:06 +02:00
parent 3a742ea2ad
commit 9eeda20d88
Signed by: liza
GPG Key ID: 7199F8D727D55F67
5 changed files with 20 additions and 4 deletions

View File

@ -46,6 +46,13 @@ internal sealed class UnmountTask(ICondition condition, ILogger<UnmountTask> log
return ETaskResult.StillRunning;
}
if (condition[ConditionFlag.Mounted] && condition[ConditionFlag.InCombat])
{
_unmountTriggered = gameFunctions.Unmount();
_continueAt = DateTime.Now.AddSeconds(1);
return ETaskResult.StillRunning;
}
return condition[ConditionFlag.Mounted]
? ETaskResult.StillRunning
: ETaskResult.TaskComplete;

View File

@ -72,6 +72,7 @@ internal static class UseItem
.With(null, EAetheryteLocation.Limsa, territoryId);
yield return serviceProvider.GetRequiredService<AethernetShortcut.UseAethernetShortcut>()
.With(EAetheryteLocation.Limsa, EAetheryteLocation.LimsaArcanist);
yield return serviceProvider.GetRequiredService<WaitAtEnd.WaitDelay>();
yield return serviceProvider.GetRequiredService<Move.MoveInternal>()
.With(territoryId, destination, dataId: npcId, sprint: false);
yield return serviceProvider.GetRequiredService<Interact.DoInteract>()

View File

@ -130,7 +130,7 @@ internal static class Move
return With(
territoryId: step.TerritoryId,
destination: destination,
stopDistance: step.StopDistance,
stopDistance: step.CalculateActualStopDistance(),
dataId: step.DataId,
disableNavMesh: step.DisableNavmesh,
sprint: step.Sprint != false,

View File

@ -38,7 +38,8 @@ internal sealed class QuestValidator
{
foreach (var issue in validator.Validate(quest))
{
_logger.LogWarning(
var level = issue.Severity == EIssueSeverity.Error ? LogLevel.Warning : LogLevel.Information;
_logger.Log(level,
"Validation failed: {QuestId} ({QuestName}) / {QuestSequence} / {QuestStep} - {Description}",
issue.QuestId, quest.Info.Name, issue.Sequence, issue.Step, issue.Description);
_validationIssues.Add(issue);

View File

@ -75,7 +75,14 @@ internal sealed class DebugOverlay : Window
for (int i = currentQuest.Step; i <= sequence.Steps.Count; ++i)
{
QuestStep? step = sequence.FindStep(i);
DrawStep(i.ToString(CultureInfo.InvariantCulture), step);
if (step == null || step.Position == null)
continue;
DrawStep(i.ToString(CultureInfo.InvariantCulture), step,
Vector3.Distance(_clientState.LocalPlayer!.Position, step.Position.Value) <
step.CalculateActualStopDistance()
? 0xFF00FF00
: 0xFF0000FF);
}
}
@ -94,7 +101,7 @@ internal sealed class DebugOverlay : Window
}
}
private void DrawStep(string counter, QuestStep? step, uint color = 0xFF0000FF)
private void DrawStep(string counter, QuestStep? step, uint color)
{
if (step == null ||
step.Position == null ||