public ITask Unmount()
{
- return new UnmountTask(condition, loggerFactory.CreateLogger<UnmountTask>(), gameFunctions);
+ return new UnmountTask(condition, loggerFactory.CreateLogger<UnmountTask>(), gameFunctions, clientState);
}
}
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
{
private bool _unmountTriggered;
if (_continueAt >= DateTime.Now)
return ETaskResult.StillRunning;
+ if (IsUnmounting())
+ return ETaskResult.StillRunning;
+
if (!_unmountTriggered)
{
// if still flying, we still need to land
: ETaskResult.TaskComplete;
}
+ private unsafe bool IsUnmounting() => **(byte**)(clientState.LocalPlayer!.Address + 1432) == 1;
+
public override string ToString() => "Unmount";
}