diff --git a/BossMod/Framework/ActionManagerEx.cs b/BossMod/Framework/ActionManagerEx.cs index 633bb14c7a..ce1507329f 100644 --- a/BossMod/Framework/ActionManagerEx.cs +++ b/BossMod/Framework/ActionManagerEx.cs @@ -359,6 +359,7 @@ private bool UseActionLocationDetour(ActionManager* self, ActionType actionType, private void ProcessPacketActionEffectDetour(uint casterID, FFXIVClientStructs.FFXIV.Client.Game.Character.BattleChara* casterObj, Vector3* targetPos, Network.ServerIPC.ActionEffectHeader* header, ulong* effects, ulong* targets) { + var packetAnimLock = header->animationLockTime; if (ActionEffectReceived != null) { // note: there's a slight difference with dispatching event from here rather than from packet processing (ActionEffectN) functions @@ -412,9 +413,18 @@ private void ProcessPacketActionEffectDetour(uint casterID, FFXIVClientStructs.F float adjDelay = animLockDelay; if (adjDelay > AnimationLockDelayMax) { - animLockReduction = Math.Min(adjDelay - AnimationLockDelayMax, currAnimLock); - adjDelay -= animLockReduction; - Utils.WriteField(_inst, 8, currAnimLock - animLockReduction); + // sanity check for plugin conflicts + if (header->animationLockTime != packetAnimLock || packetAnimLock % 0.01 is >= 0.0005f and <= 0.0095f) + { + Service.Log($"[AMEx] Unexpected animation lock {packetAnimLock:f} -> {header->animationLockTime:f}, disabling anim lock tweak feature"); + Config.RemoveAnimationLockDelay = false; + } + else + { + animLockReduction = Math.Min(adjDelay - AnimationLockDelayMax, currAnimLock); + adjDelay -= animLockReduction; + Utils.WriteField(_inst, 8, currAnimLock - animLockReduction); + } } AnimationLockDelayAverage = adjDelay * (1 - AnimationLockDelaySmoothing) + AnimationLockDelayAverage * AnimationLockDelaySmoothing; }