Thread Tools Display Modes
01-09-14, 08:13 PM   #1
Simca
An Aku'mai Servant
 
Simca's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 33
GetLootSourceInfo() Partially Broken in 5.4.2?

Hi all,

I do occasional dev work on an addon that deals with looting, and I've noticed some odd occurrences since Patch 5.4.2 under one specific scenario: when a player opens an item container from their inventory, sometimes GetLootSourceInfo(slot) will return 'nil' for argument 1 instead of a GUID.

I'm having a lot of difficulty replicating this error though. When I first log in, normally everything works fine. When I try containers that only have money after a few hours, they're fine too. After I loot a container with only an item (or multiple items) after several hours of playing (inevitably triggering whatever causes this bug in the meantime), then all containers forwards will be bugged as described in the first paragraph.

The code I'm using isn't really mine to post otherwise I would, but it's fairly simple. It securely hooks "UseContainerItem" and "UseItemByName". If the function hooked is UseItemByName, it converts the argument from an item link to an item ID. It looks through your bags with a loop to find the first bag_index and slot_index with the same item ID. UseContainerItem natively returns bag_index and slot_index. All of my testing is done by UseContainerItem anyway. Afterwards, it checks the "is_lootable" arg of GetContainerItemInfo. If it is lootable, it looks for the next "LOOT_OPENED" event to fire. When that fires, it looks at GetItemSourceInfo(), and the bug can occur.

Not sure if anyone else has encountered this or not - you would only notice this problem if you had an addon that watched every loot event, and you had extensive debugging code. If you have, it'd be a relief - the only two results on Google are completely unrelated.

Thanks!

P.S. While rapidly clicking boxes to attempt to replicate the bug, I managed some magic. I guess "AoE looting" truly does work for everything: http://i.imgur.com/ZizbwoQ.jpg
__________________
Assistant admin for MMO-Champion
WoW database file expert - ask me anything
  Reply With Quote
01-09-14, 08:32 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
GetLootSourceInfo returns the GUID of the corpse in an AOE loot situation and I don't know why it would have a value for a container from your inventory.
  Reply With Quote
01-09-14, 08:47 PM   #3
Simca
An Aku'mai Servant
 
Simca's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 33
Originally Posted by semlar View Post
GetLootSourceInfo returns the GUID of the corpse in an AOE loot situation and I don't know why it would have a value for a container from your inventory.
It returns a GUID for the containers in your inventory as well. The GUIDs it returns in that case are actually just your own character's GUID with the 'identifier' (middle 6 hex digits) being the number of item containers you have opened since login (000001, 000002, etc).

What would you use this information for? I don't really want the GUID to learn anything from it like you would with other GUIDs. I want the GUID so that if I see the same GUID again this session, I know that the user is looting the same box as they did before (and that I should ignore this loot event's set of data).

Creating a workaround to catch players opening the same box many times in many different situations would be challenging.
__________________
Assistant admin for MMO-Champion
WoW database file expert - ask me anything
  Reply With Quote
01-09-14, 09:00 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I doubt it's really intentional that openable containers in your inventory pass a value where a GUID should be, especially if the behavior is not consistent.

Originally Posted by Simca View Post
Creating a workaround to catch players opening the same box many times in many different situations would be challenging.
Why exactly do you need to keep track of this? You didn't say what your addon does, and neither of the addons you are listed as an author for appear to be related to looting, but I can't imagine it's a common scenario for users to open the same box over and over again without looting its contents.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
01-09-14, 09:48 PM   #5
Simca
An Aku'mai Servant
 
Simca's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 33
Originally Posted by Phanx View Post
I doubt it's really intentional that openable containers in your inventory pass a value where a GUID should be, especially if the behavior is not consistent.
Possibly, but it seems like a particularly specific value (number of boxes opened) to be contained within a GUID, so somebody at Blizzard must have at least considered this possibility.

Originally Posted by Phanx View Post
Why exactly do you need to keep track of this? You didn't say what your addon does, and neither of the addons you are listed as an author for appear to be related to looting, but I can't imagine it's a common scenario for users to open the same box over and over again without looting its contents.
Mainly, it's because I just want to cover every base, really. Users always come to me with the most bizarre bugs, and it's usually because they're doing something highly abnormal (that they don't realize is highly abnormal).

I may be able to find an entirely different method of doing what I want for this specific addon, but I was curious about this bug, primarily because if it does exist and the problem is not mine, then it has reprocussions for database sites like Wowhead and WoWDB who most likely use this method of tracking opened containers as well.
__________________
Assistant admin for MMO-Champion
WoW database file expert - ask me anything
  Reply With Quote
01-09-14, 11:19 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Simca View Post
Mainly, it's because I just want to cover every base, really. Users always come to me with the most bizarre bugs, and it's usually because they're doing something highly abnormal (that they don't realize is highly abnormal). I may be able to find an entirely different method of doing what I want for this specific addon, ...
Again, without knowing what you want to do it's basically impossible to offer any useful suggestions on how you might solve your problem.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » GetLootSourceInfo() Partially Broken in 5.4.2?


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