From: Liza Carvelli Date: Sat, 5 Apr 2025 17:16:58 +0000 (+0200) Subject: Add jumping as a possibility to get vnav unstuck X-Git-Tag: v5.6~7 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=9bf8e1c3416f3e8b4581ffe8e099c02fec32c0de;p=Questionable.git Add jumping as a possibility to get vnav unstuck --- diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/C1-Coerthas Central Highlands, The Enterprise/952_In Pursuit of the Past.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/C1-Coerthas Central Highlands, The Enterprise/952_In Pursuit of the Past.json index a9844776..62b33648 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/C1-Coerthas Central Highlands, The Enterprise/952_In Pursuit of the Past.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/C1-Coerthas Central Highlands, The Enterprise/952_In Pursuit of the Past.json @@ -70,6 +70,9 @@ } ] }, + { + "Sequence": 4 + }, { "Sequence": 255, "Steps": [ diff --git a/Questionable/Controller/MovementController.cs b/Questionable/Controller/MovementController.cs index 0bb7abf7..3124d64e 100644 --- a/Questionable/Controller/MovementController.cs +++ b/Questionable/Controller/MovementController.cs @@ -238,6 +238,7 @@ internal sealed class MovementController : IDisposable if (Destination.ShouldRecalculateNavmesh()) { RecalculateNavmesh(navPoints, start.Value); + return; } if (!Destination.IsFlying && !_condition[ConditionFlag.Mounted] && @@ -383,8 +384,23 @@ internal sealed class MovementController : IDisposable if (Math.Abs(distance - Destination.LastWaypoint.Distance2DAtLastUpdate) < 0.5f) { int calculations = Destination.NavmeshCalculations; - _logger.LogWarning("Recalculating navmesh (n = {Calculations})", calculations); - Restart(Destination); + if (calculations % 6 == 1) + { + _logger.LogWarning("Jumping to try and resolve navmesh problem (n = {Calculations})", + calculations); + unsafe + { + ActionManager.Instance()->UseAction(ActionType.GeneralAction, 2); + Destination.NavmeshCalculations++; + Destination.LastWaypoint.UpdatedAt = Environment.TickCount64; + } + } + else + { + _logger.LogWarning("Recalculating navmesh (n = {Calculations})", calculations); + Restart(Destination); + } + Destination.NavmeshCalculations = calculations + 1; } else