WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   GetItemSpell, when can I call it ? (https://www.wowinterface.com/forums/showthread.php?t=58904)

Sha2700 08-23-21 09:37 AM

GetItemSpell, when can I call it ?
 
Hello!

I started writing an addOn for fun, and I begin to have some timing issues...
On event "PLAYER_ENTERING_WORLD", I create the full addOn interface, registering events, etc...
Everything is OK except on login where a GetItemSpell and returns nil... After that, no more issues.
Is there any timing constraints for this function ? Does the event "PLAYER_ENTERING_WORLD" happen to soon and the Blizzard's internals are not yet fully loaded ?

Thanks !

Xrystal 08-24-21 11:02 PM

They did change how you can access certain parts of the spell data.

I use the following in my portals addon.

On PLAYER_ENTERING_WORLD event I make a call to C_Spell.RequestLoadSpellData(spellID) for each spell I will need info for.

On SPELL_DATA_LOAD_RESULT event it returns the spellID requested and whether it was loaded successfully. You can now access the data. I vaguely recall having issues retaining the info for later retrieval so it was at this point that I stored the information I needed.

Some of the spell functions I believe do not need this process. But I am not sure off the top of my head which ones they are.


All times are GMT -6. The time now is 05:08 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI