Add IsUnmounting condition to UnmountTask
This commit is contained in:
parent
cfce2591db
commit
abee323d2b
@ -29,7 +29,7 @@ internal static class Mount
|
|||||||
|
|
||||||
public ITask Unmount()
|
public ITask Unmount()
|
||||||
{
|
{
|
||||||
return new UnmountTask(condition, loggerFactory.CreateLogger<UnmountTask>(), gameFunctions);
|
return new UnmountTask(condition, loggerFactory.CreateLogger<UnmountTask>(), gameFunctions, clientState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,11 @@ internal static class Mount
|
|||||||
public override string ToString() => "Mount";
|
public override string ToString() => "Mount";
|
||||||
}
|
}
|
||||||
|
|
||||||
private sealed class UnmountTask(ICondition condition, ILogger<UnmountTask> logger, GameFunctions gameFunctions)
|
private sealed class UnmountTask(
|
||||||
|
ICondition condition,
|
||||||
|
ILogger<UnmountTask> logger,
|
||||||
|
GameFunctions gameFunctions,
|
||||||
|
IClientState clientState)
|
||||||
: ITask
|
: ITask
|
||||||
{
|
{
|
||||||
private bool _unmountTriggered;
|
private bool _unmountTriggered;
|
||||||
@ -148,6 +152,9 @@ internal static class Mount
|
|||||||
if (_continueAt >= DateTime.Now)
|
if (_continueAt >= DateTime.Now)
|
||||||
return ETaskResult.StillRunning;
|
return ETaskResult.StillRunning;
|
||||||
|
|
||||||
|
if (IsUnmounting())
|
||||||
|
return ETaskResult.StillRunning;
|
||||||
|
|
||||||
if (!_unmountTriggered)
|
if (!_unmountTriggered)
|
||||||
{
|
{
|
||||||
// if still flying, we still need to land
|
// if still flying, we still need to land
|
||||||
@ -172,6 +179,8 @@ internal static class Mount
|
|||||||
: ETaskResult.TaskComplete;
|
: ETaskResult.TaskComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private unsafe bool IsUnmounting() => **(byte**)(clientState.LocalPlayer!.Address + 1432) == 1;
|
||||||
|
|
||||||
public override string ToString() => "Unmount";
|
public override string ToString() => "Unmount";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user