From 656ec41c7487e24d7a8d3778f78f29191d6d19d6 Mon Sep 17 00:00:00 2001 From: diwo Date: Mon, 6 Mar 2023 00:04:42 -0800 Subject: [PATCH] Override redirection using /ac with placeholder --- Redirect/GameHooks.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Redirect/GameHooks.cs b/Redirect/GameHooks.cs index 13b334d..d6145ce 100644 --- a/Redirect/GameHooks.cs +++ b/Redirect/GameHooks.cs @@ -171,12 +171,12 @@ private CursorStatus ValidateCursorPlacement(IntPtr action_manager, Lumina.Excel } } - public GameObject? ResolveTarget(string target) { - return target switch { + public GameObject? ResolveTarget(string targetOption, ulong originalTarget) { + return targetOption switch { "UI Mouseover" => CurrentUIMouseover, "Model Mouseover" => TargetManager.MouseOverTarget, "Self" => Services.ClientState.LocalPlayer, - "Target" => TargetManager.Target, + "Target" => Services.ObjectTable.SearchById(originalTarget) ?? TargetManager.Target, "Focus" => TargetManager.FocusTarget, "Target of Target" => TargetManager.Target is { } ? TargetManager.Target.TargetObject : null, "Soft Target" => TargetManager.SoftTarget, @@ -257,7 +257,7 @@ private unsafe bool TryActionCallback(IntPtr action_manager, ActionType type, ui } } else { - GameObject? nt = ResolveTarget(t); + GameObject? nt = ResolveTarget(t, target); if (nt is not null) { bool ok = adjusted_row.TargetInRangeAndLOS(nt, out var err); bool tt_ok = adjusted_row.TargetTypeValid(nt);