Skip to content

Commit

Permalink
Hack to fix autoattack issue with animlocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Apr 27, 2024
1 parent 2401b18 commit 2d0ba37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BossMod/Debug/DebugAddon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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!"))
Expand Down
4 changes: 2 additions & 2 deletions BossMod/Framework/ActionManagerEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2d0ba37

Please sign in to comment.