Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

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

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