Rarity

Rarity

17M Downloads

Pickpocketing may cause subsequent loot events to be ignored even if there are items of interest

rdw-software opened this issue ยท 3 comments

commented

Source: WowAce

I've noticed when playing on my rogue that any mob that I kill is only tracked as an attempt if I have NOT attempted to pick their pockets beforehand. if I just straight up kill them, all is well and once looted the attempts are counted. anything pickpocketed may as well not exist as far as the addon is concerned

If I understand correctly, the issue may be that Rarity ignores the NPC after it's been "looted" twice (pickpocketing + on kill).

commented

Looking at the code, I suspect the NPC is simply "checked off" after the pickpocket completes and the loot window is opened.

Source:

Rarity/Core.lua

Line 756 in 62e7b13

if Rarity.guids[guid] ~= nil then

If this is the issue, then the list of "seen" NPCs could be split into two lists, one for loot and another for pickpocketing events.

commented

The problem can be observed in the table inspector:

  1. Type /tinspect Rarity.guids
  2. Use Pick Pocket on the target
  3. The GUID is checked off and subsequent loot events will be ignored

The next question then is where exactly the pick pocket event leads to the GUID being checked off. I believe there is no special handling since Blizzard's UI only sends generic UNIT_SPELLCAST_SUCCEEDED and then LOOT_READY / LOOT_OPENED events when pick-pocketing an enemy. Rarity therefore can't differentiate between a regular loot attempt and Pick Pocket.

In other words, it's all the same CheckNpcInterest handling, which would be called twice in this scenario.

commented

Turns out the solution is quite simple: Just don't set the guids entry if the requiresPickpocket flag is enabled.
There can't be issues with duplicate attempts since the game prevents the spell from being cast twice. And looting an enemy more than once is similarly impossible. Both attempts are differentiated by the target state - if it's not dead, Rarity assumes Pick Pocket.