Ah, my bad. I thought I had broken it. Thanks for the explanation. I'll add your second pass code back in and move the check back out from the inner loop. I'll do that tonight after work and release a new version. I am liking the changes, I'll be using Advanced Loot extensively in WoD.

Quote Originally Posted by Tehtsuo View Post
Your changes look pretty clean, and I like how you encapsulated the loot alerts to trim down the main loot function.

On the loot behavior - it looks like you've trimmed the loot code down to a single pass through the loot window, checking for items in the watch list or that match the filters. The problem with that is if there is a non-watched item above a watched one in the loot window it needs to leave that non-watched item. With only one pass through the loot window it won't know. This is especially a concern since the first slot on most loot windows is gold - with your loop, the first character that loots will get through the loop to the end with safeToLoot set true, and loot the gold. Then any other character will have a good chance of not seeing sparklies on the targeted corpse and you'll have to switch to that character and find a still-sparkling corpse.

My version has two loops through the loot window slots each time through the main loop. The first loop just checks for watched/BoP/BoE/Cloth and if the player is a target for anything it loots it. the second loop picks up everything else, but is skipped if the first loot found anything targeted for another player.

Let me know what you think, and feel free to chat me up if you have questions.