wardz / DRList-1.0

[WoW] Library for providing player diminishing returns categorization.
16 stars 10 forks source link

Heads up regarding GetSpellInfo that is deprecated in The War Within #23

Closed ryulinho closed 3 months ago

ryulinho commented 3 months ago

GetSpellInfo was replaced with C_Spell.GetSpellInfo

It returns information differently - here is an example for Divine Shield.

/dump GellSpellInfo(642) Dump: value=GetSpellInfo(642) [1]="Divine Shield", [3]=524354, [4]=0, [5]=0, [6]=0, [7]=642, [8]=524354

/dump C_Spell.GetSpellInfo(642) Dump: value=C_Spell.GetSpellInfo(642) [1]={ castTime=0, name="Divine Shield", minRange=0, originalIconID=524354, icondID=524354, maxRange=0, spellID=642 }

wardz commented 3 months ago

Should be fixed with PR #22 I think, which uses C_Spell.GetSpellName instead of C_Spell.GetSpellInfo. I don't have the retail/ptr client installed atm to verify it, but im assuming it works.

ryulinho commented 3 months ago

I have the beta client for TWW installed. I can confirm that the following code outputs "Mind Control".

local GetSpellName = C_Spell and C_Spell.GetSpellName or GetSpellInfo print(GetSpellName(605))

wardz commented 3 months ago

Thanks for confirming.