Skip to content

Commit

Permalink
Add overrideSpellID specifically for Kua'fon which is still weird #314
Browse files Browse the repository at this point in the history
  • Loading branch information
mbattersby committed Feb 14, 2025
1 parent 635977a commit 297b6fe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions LM_Journal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,25 @@ function LM.Journal:Get(id)
Mixin(m.flags, typeInfo.flags)
end

-- Kua'fon is still weird, there are two spells that summon it, 267270 which
-- is what the journal returns, and 301841 which at least one of my alts gets
-- (Tandarin). Is that the toon that originally upgraded it to flying when that
-- was required? I have no idea how to tell.
if m.spellID == 267270 then
m.overrideSpellID = 301841
end

return m
end

--[[
-- Starting in TWW Kua'fon is no longer its own mount type and just a
-- regular skyriding mount (id 424).
function LM.Journal:GetFlags()
local flags = LM.Mount.GetFlags(self)
-- XXX FIXME XXX is this still required at all? If so it should be fixed
-- Dynamic Kua'fon flags
if self.mountTypeID == 398 then
flags = CopyTable(flags)
Expand All @@ -100,9 +112,9 @@ function LM.Journal:GetFlags()
flags.RUN = true
end
end

return flags
end
]]

function LM.Journal:IsUsable()
local usable = select(5, C_MountJournal.GetMountInfoByID(self.mountID))
Expand Down
4 changes: 2 additions & 2 deletions MountRegistry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local C_Spell = LM.C_Spell

local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0", true)

local IndexAttributes = { 'mountID', 'name', 'spellID' }
local IndexAttributes = { 'mountID', 'name', 'spellID', 'overrideSpellID' }

LM.MountRegistry = CreateFrame("Frame", nil, UIParent)
LM.MountRegistry.callbacks = CallbackHandler:New(LM.MountRegistry)
Expand Down Expand Up @@ -91,7 +91,7 @@ function LM.MountRegistry:OnEvent(event, ...)
self.needRefresh = true
elseif event == "UNIT_SPELLCAST_SUCCEEDED" then
local _, _, spellID = ...
local m = self.indexes.spellID[spellID]
local m = self.indexes.spellID[spellID] or self.indexes.overrideSpellID[spellID]
if m then
m:OnSummon()
self.callbacks:Fire("OnMountSummoned", m)
Expand Down

0 comments on commit 297b6fe

Please sign in to comment.