View Single Post
02-21-23, 05:50 PM   #6
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
Hi Fizzlemizz

You are right.
Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:SetScript(
  3.     "OnEvent",
  4.     function(self, event, ...)
  5.         if event == "UNIT_SPELLCAST_SUCCEEDED" then
  6.             _, _, spellID = ...
  7.             mountID = C_MountJournal.GetMountFromSpell(spellID)
  8.             for k, v in pairs(C_MountJournal.GetMountIDs()) do
  9.                 if v == mountID then
  10.                     Dismount()
  11.                 end
  12.             end
  13.         end
  14.     end
  15. )
  16.  
  17. f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")

Thanks for your help.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote