I'm CTRL-Click a nave for a toon that have multiple mails with multiple attachments. Sometimes, only the first one of only one of the mail is extracted.
Excample: 3 mail, mail 1 = 12 attachments, mail 4 = 12 attachments, mail 9 = 9 attachments.
Result (this has just happened to me): 9 attachments from mail 9 extracted, 1 attachment from mail 4 extracted, 12 attachments from mail 1 extracted. 11 attachments from mail 4 were left in the mail box.
Ok, looking at the code again, and using your description to narrow down the culprit behavior (that is, mailIndex variable is decrementing when it should not be), this behavior can happen if your opening speed is too fast, and is a bug.
Go open Select.lua and comment out lines 293-296 and add one additional line, that is after commenting out those 4 lines and adding the additional line, it should look like this:
selectedMail[mailIndex] = nil
if lastItem and lastItem ~= GetInboxNumItems() then
-- the last attachment or gold taken auto deleted the mail so move on to the next mail
mailIndex = mailIndex - 1
attachIndex = ATTACHMENTS_MAX_RECEIVE
lastItem = nil
return self:ProcessNext() -- tail call
--mailIndex = mailIndex - 1
--attachIndex = ATTACHMENTS_MAX_RECEIVE
--lastItem = nil
--return self:ProcessNext() -- tail call
[/php]Clearly a logic error, since the if-check doesn't matter at all if the contents of the IF check (lines 288-291) is the same as the stuff outside the check (293-296).
See if that helps. The same logic error is also in OpenAll.lua.