Skip aetheryte teleport if you're standing within interaction distance of your target
This commit is contained in:
parent
0bd15c03f5
commit
917ae4f4b8
@ -9,6 +9,8 @@ namespace Questionable.Model.V1;
|
|||||||
|
|
||||||
public sealed class QuestStep
|
public sealed class QuestStep
|
||||||
{
|
{
|
||||||
|
public const float DefaultStopDistance = 3f;
|
||||||
|
|
||||||
public EInteractionType InteractionType { get; set; }
|
public EInteractionType InteractionType { get; set; }
|
||||||
|
|
||||||
public uint? DataId { get; set; }
|
public uint? DataId { get; set; }
|
||||||
@ -64,4 +66,12 @@ public sealed class QuestStep
|
|||||||
Position = position;
|
Position = position;
|
||||||
TerritoryId = territoryId;
|
TerritoryId = territoryId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float CalculateActualStopDistance()
|
||||||
|
{
|
||||||
|
if (InteractionType == EInteractionType.WalkTo)
|
||||||
|
return StopDistance ?? 0.25f;
|
||||||
|
else
|
||||||
|
return StopDistance ?? DefaultStopDistance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,6 @@ namespace Questionable.Controller;
|
|||||||
|
|
||||||
internal sealed class MovementController : IDisposable
|
internal sealed class MovementController : IDisposable
|
||||||
{
|
{
|
||||||
public const float DefaultStopDistance = 3f;
|
|
||||||
|
|
||||||
private static readonly List<BlacklistedArea> BlacklistedAreas =
|
private static readonly List<BlacklistedArea> BlacklistedAreas =
|
||||||
[
|
[
|
||||||
new(1191, new(-223.0412f, 31.937134f, -584.03906f), 5f, 7.75f),
|
new(1191, new(-223.0412f, 31.937134f, -584.03906f), 5f, 7.75f),
|
||||||
@ -266,7 +264,7 @@ internal sealed class MovementController : IDisposable
|
|||||||
_chatFunctions.ExecuteCommand("/automove off");
|
_chatFunctions.ExecuteCommand("/automove off");
|
||||||
}
|
}
|
||||||
|
|
||||||
Destination = new DestinationData(dataId, to, stopDistance ?? (DefaultStopDistance - 0.2f), fly, sprint,
|
Destination = new DestinationData(dataId, to, stopDistance ?? (QuestStep.DefaultStopDistance - 0.2f), fly, sprint,
|
||||||
useNavmesh);
|
useNavmesh);
|
||||||
MovementStartedAt = DateTime.MaxValue;
|
MovementStartedAt = DateTime.MaxValue;
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,12 @@ internal static class AetheryteShortcut
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vector3 pos = clientState.LocalPlayer!.Position;
|
Vector3 pos = clientState.LocalPlayer!.Position;
|
||||||
|
if (Step.Position != null && (pos - Step.Position.Value).Length() < Step.CalculateActualStopDistance())
|
||||||
|
{
|
||||||
|
logger.LogInformation("Skipping aetheryte teleport, we're near the target");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (aetheryteData.CalculateDistance(pos, territoryType, TargetAetheryte) < 20 ||
|
if (aetheryteData.CalculateDistance(pos, territoryType, TargetAetheryte) < 20 ||
|
||||||
(Step.AethernetShortcut != null &&
|
(Step.AethernetShortcut != null &&
|
||||||
(aetheryteData.CalculateDistance(pos, territoryType, Step.AethernetShortcut.From) < 20 ||
|
(aetheryteData.CalculateDistance(pos, territoryType, Step.AethernetShortcut.From) < 20 ||
|
||||||
|
@ -69,12 +69,7 @@ internal static class Move
|
|||||||
yield return new WaitConditionTask(() => movementController.IsNavmeshReady,
|
yield return new WaitConditionTask(() => movementController.IsNavmeshReady,
|
||||||
"Wait(navmesh ready)");
|
"Wait(navmesh ready)");
|
||||||
|
|
||||||
float distance;
|
float distance = Step.CalculateActualStopDistance();
|
||||||
if (Step.InteractionType == EInteractionType.WalkTo)
|
|
||||||
distance = Step.StopDistance ?? 0.25f;
|
|
||||||
else
|
|
||||||
distance = Step.StopDistance ?? MovementController.DefaultStopDistance;
|
|
||||||
|
|
||||||
var position = clientState.LocalPlayer?.Position ?? new Vector3();
|
var position = clientState.LocalPlayer?.Position ?? new Vector3();
|
||||||
float actualDistance = (position - Destination).Length();
|
float actualDistance = (position - Destination).Length();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user