View Single Post
02-20-23, 11:57 PM   #4
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 237
I have now accepted that I will have to dismount after the player has mounted.

To do this I have the following chunk:
Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:SetScript(
  3.     "OnEvent",
  4.     function(self, event, ...)
  5.         if event == "UNIT_SPELLCAST_SUCCEEDED" then
  6.             unit, spellGUID, spellID = ...
  7.             print("UNIT_SPELLCAST_SUCCEEDED", unit, spellGUID, spellID)
  8.             for k, v in pairs(C_MountJournal.GetMountIDs()) do
  9.                 if v == spellID then
  10.                     print("found")
  11.                 end
  12.             end
  13.         end
  14.     end
  15. )
  16. f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")

I cannot work out why I never print found, but maybe I am too close to see the error.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote