From 8aaabacc2d96016eb21781c26fb2e0b3616d5dbf Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Wed, 21 Aug 2024 20:33:40 +0200 Subject: [PATCH] Attempt to fix diving movement issue --- Directory.Build.targets | 2 +- .../Arkasodara/Dailies/4573_Gathering Moss.json | 11 +---------- Questionable/Controller/MovementController.cs | 3 ++- Questionable/Controller/Steps/Shared/MoveTo.cs | 9 --------- Questionable/Functions/GameFunctions.cs | 17 ++++++++++------- 5 files changed, 14 insertions(+), 28 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 7aba154f4..db4a3c208 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,5 @@ - 2.12 + 2.13 diff --git a/QuestPaths/6.x - Endwalker/Allied Societies/Arkasodara/Dailies/4573_Gathering Moss.json b/QuestPaths/6.x - Endwalker/Allied Societies/Arkasodara/Dailies/4573_Gathering Moss.json index 380b35fe8..06b876996 100644 --- a/QuestPaths/6.x - Endwalker/Allied Societies/Arkasodara/Dailies/4573_Gathering Moss.json +++ b/QuestPaths/6.x - Endwalker/Allied Societies/Arkasodara/Dailies/4573_Gathering Moss.json @@ -42,16 +42,6 @@ } } }, - { - "Position": { - "X": 103.41005, - "Y": -23.878786, - "Z": 187.79831 - }, - "TerritoryId": 957, - "InteractionType": "WalkTo", - "DisableNavmesh": true - }, { "DataId": 2012907, "Position": { @@ -61,6 +51,7 @@ }, "TerritoryId": 957, "InteractionType": "Interact", + "DisableNavmesh": true, "CompletionQuestVariablesFlags": [ null, null, diff --git a/Questionable/Controller/MovementController.cs b/Questionable/Controller/MovementController.cs index 2f40a3bea..6809c9f1e 100644 --- a/Questionable/Controller/MovementController.cs +++ b/Questionable/Controller/MovementController.cs @@ -151,8 +151,9 @@ internal sealed class MovementController : IDisposable if (IsPathRunning && Destination != null) { - if (_gameFunctions.IsLoadingScreenVisible()) + if (_gameFunctions.IsLoadingScreenVisible(false)) { + _logger.LogInformation("Stopping movement, loading screen visible"); Stop(); return; } diff --git a/Questionable/Controller/Steps/Shared/MoveTo.cs b/Questionable/Controller/Steps/Shared/MoveTo.cs index 1ba43fdbc..a24fb2f09 100644 --- a/Questionable/Controller/Steps/Shared/MoveTo.cs +++ b/Questionable/Controller/Steps/Shared/MoveTo.cs @@ -115,15 +115,6 @@ internal static class MoveTo actualDistance = float.MaxValue; } - // In particular, MoveBuilder is used so early that it'll have the position when you're starting gathering, - // not when you're finished. - if (questId is SatisfactionSupplyNpcId) - { - logger.LogDebug("SatisfactionSupply: Changing distance to max, previous distance: {Distance}", - actualDistance); - actualDistance = float.MaxValue; - } - if (step.Mount == true) yield return mountFactory.Mount(step.TerritoryId, Mount.EMountIf.Always); else if (step.Mount == false) diff --git a/Questionable/Functions/GameFunctions.cs b/Questionable/Functions/GameFunctions.cs index 32b35ce7b..fda0c60d9 100644 --- a/Questionable/Functions/GameFunctions.cs +++ b/Questionable/Functions/GameFunctions.cs @@ -398,7 +398,7 @@ internal sealed unsafe class GameFunctions if (!_clientState.IsLoggedIn || _clientState.LocalPlayer == null) return true; - if (IsLoadingScreenVisible()) + if (IsLoadingScreenVisible(true)) return true; if (_condition[ConditionFlag.Crafting]) @@ -437,16 +437,19 @@ internal sealed unsafe class GameFunctions flags.Contains(ConditionFlag.OccupiedInQuestEvent); } - public bool IsLoadingScreenVisible() + public bool IsLoadingScreenVisible(bool all) { - if (_gameGui.TryGetAddonByName("FadeMiddle", out AtkUnitBase* fade) && fade->IsVisible) + if (_gameGui.TryGetAddonByName("FadeMiddle", out AtkUnitBase* fade) && LAddon.IsAddonReady(fade) && fade->IsVisible) return true; - if (_gameGui.TryGetAddonByName("FadeBack", out fade) && fade->IsVisible) - return true; + if (all) + { + if (_gameGui.TryGetAddonByName("FadeBack", out fade) && LAddon.IsAddonReady(fade) && fade->IsVisible) + return true; - if (_gameGui.TryGetAddonByName("NowLoading", out fade) && fade->IsVisible) - return true; + if (_gameGui.TryGetAddonByName("NowLoading", out fade) && LAddon.IsAddonReady(fade) && fade->IsVisible) + return true; + } return false; }