From 2d0ba37f24ebba462337b550bed863705c22365a Mon Sep 17 00:00:00 2001 From: Andrew Gilewsky Date: Sat, 27 Apr 2024 21:27:37 +0100 Subject: [PATCH] Hack to fix autoattack issue with animlocks. --- BossMod/Debug/DebugAddon.cs | 2 +- BossMod/Framework/ActionManagerEx.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BossMod/Debug/DebugAddon.cs b/BossMod/Debug/DebugAddon.cs index 346cba33e9..0d99b22d01 100644 --- a/BossMod/Debug/DebugAddon.cs +++ b/BossMod/Debug/DebugAddon.cs @@ -77,7 +77,7 @@ public void Draw() } } } - if (_newHook.Length > 0 && uint.TryParse(_newHook, out var agentId) && agentId > 0 && !_agentRcvs.ContainsKey(agentId) && AgentModule.Instance()->GetAgentByInternalID(agentId) is var agent && agent != null) + if (_newHook.Length > 0 && uint.TryParse(_newHook, out var agentId) && agentId > 0 && !_agentRcvs.ContainsKey(agentId) && AgentModule.Instance()->GetAgentByInternalId((AgentId)agentId) is var agent && agent != null) { ImGui.SameLine(); if (ImGui.Button("Hook agent!")) diff --git a/BossMod/Framework/ActionManagerEx.cs b/BossMod/Framework/ActionManagerEx.cs index 64c8354e03..8d365d4c7d 100644 --- a/BossMod/Framework/ActionManagerEx.cs +++ b/BossMod/Framework/ActionManagerEx.cs @@ -418,9 +418,9 @@ private void ProcessPacketActionEffectDetour(uint casterID, FFXIVClientStructs.F _processPacketActionEffectHook.Original(casterID, casterObj, targetPos, header, effects, targets); var currAnimLock = AnimationLock; - if (casterID != Service.ClientState.LocalPlayer?.ObjectId) + if (casterID != Service.ClientState.LocalPlayer?.ObjectId || header->SourceSequence == 0 && _lastReqSequence != 0) { - // non-player-initiated + // non-player-initiated; TODO: reconsider the condition for header->SourceSequence == 0 (e.g. autos) - could they happen while we wait for stuff like reholster?.. if (currAnimLock != prevAnimLock) Service.Log($"[AMEx] Animation lock updated by non-player-initiated action: #{header->SourceSequence} {casterID:X} {action} {prevAnimLock:f3} -> {currAnimLock:f3}"); return;