Fix teleport v2.8
authorLiza Carvelli <liza@carvel.li>
Wed, 14 Aug 2024 11:41:53 +0000 (13:41 +0200)
committerLiza Carvelli <liza@carvel.li>
Wed, 14 Aug 2024 11:41:53 +0000 (13:41 +0200)
Directory.Build.targets
Questionable/Controller/Steps/Shared/AetheryteShortcut.cs
Questionable/Functions/AetheryteFunctions.cs

index 2ad15fb9dd746e87a6e3ca1b410a80344fcbcf42..61c30fda4810559f5a589be477f301f8af3d5498 100644 (file)
@@ -1,5 +1,5 @@
 <Project>
     <PropertyGroup>
-        <Version>2.7</Version>
+        <Version>2.8</Version>
     </PropertyGroup>
 </Project>
index c111e5bafe59c6858e58cd78acb4fc8ea2f6e781..9da8a019bb3b170479dbbd13affbf5e1c2b6fa36 100644 (file)
@@ -145,6 +145,8 @@ internal static class AetheryteShortcut
                 if (!aetheryteFunctions.IsTeleportUnlocked())
                     throw new TaskException("Teleport is not unlocked, attune to any aetheryte first.");
 
+                _continueAt = DateTime.Now.AddSeconds(1);
+                logger.LogTrace("Waiting for teleport cooldown...");
                 return false;
             }
 
index a4e65661af30f8f55318801f2104d21cb91d996f..0388b024672248587f2cb7164410994392c2b8b1 100644 (file)
@@ -8,13 +8,14 @@ using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
 using Questionable.Model.Common;
 using Questionable.Model.Questing;
+using Action = Lumina.Excel.GeneratedSheets.Action;
 
 namespace Questionable.Functions;
 
 internal sealed unsafe class AetheryteFunctions
 {
     private const uint TeleportAction = 5;
-    private const uint ReturnAction = 8;
+    private const uint ReturnAction = 6;
 
     private readonly IServiceProvider _serviceProvider;
     private readonly ILogger<AetheryteFunctions> _logger;
@@ -48,16 +49,16 @@ internal sealed unsafe class AetheryteFunctions
     public bool CanTeleport(EAetheryteLocation aetheryteLocation)
     {
         if ((ushort)aetheryteLocation == PlayerState.Instance()->HomeAetheryteId &&
-            ActionManager.Instance()->GetActionStatus(ActionType.GeneralAction, ReturnAction) == 0)
+            ActionManager.Instance()->GetActionStatus(ActionType.Action, ReturnAction) == 0)
             return true;
 
-        return ActionManager.Instance()->GetActionStatus(ActionType.GeneralAction, TeleportAction) == 0;
+        return ActionManager.Instance()->GetActionStatus(ActionType.Action, TeleportAction) == 0;
     }
 
     public bool IsTeleportUnlocked()
     {
-        ushort unlockLink = _dataManager.GetExcelSheet<GeneralAction>()!
-            .Single(x => x.Action.Row == 5)
+        uint unlockLink = _dataManager.GetExcelSheet<Action>()!
+            .GetRow(5)!
             .UnlockLink;
         return UIState.Instance()->IsUnlockLinkUnlocked(unlockLink);
     }
@@ -68,17 +69,17 @@ internal sealed unsafe class AetheryteFunctions
         if (IsAetheryteUnlocked(aetheryteId, out var subIndex))
         {
             if (aetheryteId == PlayerState.Instance()->HomeAetheryteId &&
-                ActionManager.Instance()->GetActionStatus(ActionType.GeneralAction, ReturnAction) == 0)
+                ActionManager.Instance()->GetActionStatus(ActionType.Action, ReturnAction) == 0)
             {
                 ReturnRequestedAt = DateTime.Now;
-                if (ActionManager.Instance()->UseAction(ActionType.GeneralAction, ReturnAction))
+                if (ActionManager.Instance()->UseAction(ActionType.Action, ReturnAction))
                 {
                     _logger.LogInformation("Using 'return' for home aetheryte");
                     return true;
                 }
             }
 
-            if (ActionManager.Instance()->GetActionStatus(ActionType.GeneralAction, TeleportAction) == 0)
+            if (ActionManager.Instance()->GetActionStatus(ActionType.Action, TeleportAction) == 0)
             {
                 // fallback if return isn't available or (more likely) on a different aetheryte
                 _logger.LogInformation("Teleporting to aetheryte {AetheryteId}", aetheryteId);