WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Strange GetItemInfo behaviour (https://www.wowinterface.com/forums/showthread.php?t=54325)

Choonstertwo 08-28-16 06:13 PM

Strange GetItemInfo behaviour
 
Someone has filed a ticket for one of my AddOns that appears to demonstrate some odd behaviour of GetItemInfo.

When called with an item ID, GetItemInfo is returning the correct results; but calling it again with the item link returned by the first call is returning nil.

Has anyone experienced this behaviour? Is there any way to avoid it?

Banknorris 08-29-16 02:47 AM

I guess that if you get nil you may want to wait for a GET_ITEM_INFO_RECEIVED event whose arg1 will be the item id. When this event triggers the link should be available. This event will trigger a little bit after you call GetItemInfo() for an item not in the cache.

Choonstertwo 08-29-16 05:56 AM

Thanks, I'll try using that.

Vlad 08-29-16 06:41 AM

You can take a look at the API GetItemInfoInstant and see what kind of data it returns, and if it's usable in your case. Perk is that it's instant and doesn't require server data of any kind. :)

Choonstertwo 08-29-16 06:53 AM

Quote:

Originally Posted by Vlad (Post 318474)
You can take a look at the API GetItemInfoInstant and see what kind of data it returns, and if it's usable in your case. Perk is that it's instant and doesn't require server data of any kind. :)

Unfortunately I'm using the alert frame system, which calls GetItemInfo itself; so I need to ensure that it returns valid results before I try to show any alerts.


All times are GMT -6. The time now is 11:43 PM.

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