[Cata Classic] v4.2.36 GetSpellInfo (in Lib) error #1442


  • Defect
Closed
  • MrFIXlT created this issue Jul 25, 2024
    10x ...ura/Libs/LibPlayerSpells-1.0-15/LibPlayerSpells-1.0.lua:440: attempt to call upvalue 'GetSpellInfo' (a nil value)
    [string "@PitBull4/Modules/Aura/Libs/LibPlayerSpells-1.0-15/LibPlayerSpells-1.0.lua"]:440: in function <...ura/Libs/LibPlayerSpells-1.0/LibPlayerSpells-1.0.lua:428>
    [string "@PitBull4/Modules/Aura/Libs/LibPlayerSpells-1.0-15/LibPlayerSpells-1.0.lua"]:546: in function `__RegisterSpells'
    [string "@PitBull4/Modules/Aura/Libs/LibPlayerSpells-1.0-15/data/Racials.lua"]:23: in main chunk
    
    Locals:
    spellId = 331868
    spellType = "spell"
    errors = <table> {
    }
    (*temporary) = nil
    (*temporary) = 331868
    (*temporary) = "attempt to call upvalue 'GetSpellInfo' (a nil value)"
    FilterSpellId = <function> defined @PitBull4/Modules/Aura/Libs/LibPlayerSpells-1.0/LibPlayerSpells-1.0.lua:428
    tinsert = <function> defined =[C]:-1
    format = <function> defined =[C]:-1
    GetSpellInfo = nil
    

     

  • MrFIXlT added a tag Defect Jul 25, 2024
  • MrFIXlT posted a comment Jul 25, 2024
    local GetSpellInfo
    do
    	if _G.GetSpellInfo then
    		GetSpellInfo = _G.GetSpellInfo
    	elseif _G.C_Spell and _G.C_Spell.GetSpellInfo then
    		GetSpellInfo = _G.C_Spell.GetSpellInfo
    	end
    end

     

    Added that to LibPlayerSpells-1.0..lua to stop the error. This will work for this particular case as the method is only used to do a simple "spell exists" check.

    For a compatibility layer for classic clients it would need to extract the fields from the table C_Spell.GetSpellInfo returns and return them as an argument list.

  • nebula169 closed issue Aug 15, 2024
  • nebula169 posted a comment Aug 15, 2024

    I made the lib not load in classic, thanks


To post a comment, please login or register a new account.