Route auto dismount through central API layer
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
local _G = ShaguTweaks.GetGlobalEnv()
|
local _G = ShaguTweaks.GetGlobalEnv()
|
||||||
local T = ShaguTweaks.T
|
local T = ShaguTweaks.T
|
||||||
|
local API = ShaguTweaks.API
|
||||||
|
|
||||||
local module = ShaguTweaks:register({
|
local module = ShaguTweaks:register({
|
||||||
title = T["Auto Dismount"],
|
title = T["Auto Dismount"],
|
||||||
@@ -99,17 +100,15 @@ module.enable = function(self)
|
|||||||
if arg1 == errorstring then
|
if arg1 == errorstring then
|
||||||
-- ClassicAPI reads the real mounted/form state directly, avoiding a
|
-- ClassicAPI reads the real mounted/form state directly, avoiding a
|
||||||
-- 32-buff tooltip scan in the normal case.
|
-- 32-buff tooltip scan in the normal case.
|
||||||
if IsMounted and IsMounted() and Dismount then
|
if API.IsMounted() then
|
||||||
Dismount()
|
API.Dismount()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if GetShapeshiftFormID and CancelShapeshiftForm then
|
local formID = API.GetShapeshiftFormID()
|
||||||
local formID = GetShapeshiftFormID()
|
if removableForms[formID] then
|
||||||
if removableForms[formID] then
|
API.CancelShapeshiftForm()
|
||||||
CancelShapeshiftForm()
|
return
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Preserve compatibility with custom private-server auras/forms.
|
-- Preserve compatibility with custom private-server auras/forms.
|
||||||
|
|||||||
Reference in New Issue
Block a user