View Single Post
11/19/14, 10:31 PM   #7
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Originally Posted by merlight View Post
They might have changed it, but I don't think so. I did the same thing some time ago (the addon in question still has APIVersion 100008), and FindFirstEmptySlotInBag kept returning the same value over and over.
Might be a base issue, but Garkin was looking at this in brekal's code:

Lua Code:
  1. function LootManager.MoveItem(srcBag, srcSlot, destBag, destSlot, quantity)
  2.     --...
  3.     zo_callLater(function()
  4.         --Actual move in here, delayed 500ms
  5.     end, 500)  
  6.     --...
  7. end
This introduces a delay for actually executing the move, and iterating through the list (hopefully) finishes in <500ms so they're all looking at the same slot.

What is the purpose of the delay? If you're trying to not flood the server (which could result in a forced logout), it doesn't work as written. zo_callLater is non-blocking, so it will exit the main function and continue in the loop without waiting at all. You'll end up with all the actual move attempts ~500ms later still close enough to flip a message rate limit.
  Reply With Quote