Closed rdw-software closed 5 months ago
Looking at the code, I suspect the NPC is simply "checked off" after the pickpocket completes and the loot window is opened.
Source: https://github.com/WowRarity/Rarity/blob/62e7b13af6953db51f689430cbe3b0a7f5a3b520/Core.lua#L756
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.
The problem can be observed in the table inspector:
/tinspect Rarity.guids
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.
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.
Source: WowAce
If I understand correctly, the issue may be that Rarity ignores the NPC after it's been "looted" twice (pickpocketing + on kill).