Thread Tools Display Modes
08-28-16, 06:13 PM   #1
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
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?
  Reply With Quote
08-29-16, 02:47 AM   #2
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
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.
__________________
"In this world nothing can be said to be certain, except that fractional reserve banking is a Ponzi scheme and that you won't believe it." - Mandrill
  Reply With Quote
08-29-16, 05:56 AM   #3
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
Thanks, I'll try using that.
  Reply With Quote
08-29-16, 06:41 AM   #4
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
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.
__________________
Profile: Curse | Wowhead
  Reply With Quote
08-29-16, 06:53 AM   #5
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
Originally Posted by Vlad View Post
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.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Strange GetItemInfo behaviour

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off