From f84661ad99c6fcd7f694e4951cb5eb54de342952 Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+NoM0Re@users.noreply.github.com> Date: Thu, 12 Jun 2025 02:46:14 +0200 Subject: [PATCH] revisit Mounted Frame --- WeakAuras/GenericTrigger.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 048d309..4989b62 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -3694,10 +3694,9 @@ do isMounted = IsMounted() Private.ScanForLoads(nil, "MOUNTED_UPDATE") Private.ScanEvents("MOUNTED_UPDATE") - mountedFrame:SetScript("OnUpdate", nil) - end - if(elapsed > delay) then - mountedFrame:SetScript("OnUpdate", nil) + self:SetScript("OnUpdate", nil) + elseif(elapsed > delay) then + self:SetScript("OnUpdate", nil) end Private.StopProfileSystem("generictrigger mounted") end @@ -3707,10 +3706,10 @@ do mountedFrame = CreateFrame("Frame") Private.frames["Mount Use Handler"] = mountedFrame mountedFrame:RegisterEvent("COMPANION_UPDATE") - mountedFrame:SetScript("OnEvent", function(_, _, arg) + mountedFrame:SetScript("OnEvent", function(self, _, arg) if arg == "MOUNT" then elapsed = 0 - mountedFrame:SetScript("OnUpdate", checkForMounted) + self:SetScript("OnUpdate", checkForMounted) end end) end