# HG changeset patch # User John@Yosemite-PC # Date 1331502446 14400 # Node ID 731182d55b6c9d4cc3014f9c5a22e2f6e11f562b # Parent eb3a3f69559e7a6d802932fd64f1d3743c3e5df0 Bug fix (iterate list by ipairs) Cleanup to RemovePerson diff -r eb3a3f69559e -r 731182d55b6c Lists.lua --- a/Lists.lua Sun Mar 11 17:27:31 2012 -0400 +++ b/Lists.lua Sun Mar 11 17:47:26 2012 -0400 @@ -425,11 +425,9 @@ local listsTheyreOn = {} -- check if they're active on any loot list for i,v in pairs(bsk.lists) do - for x,y in ipairs(v) do - if y.id == id then - tinsert(listsTheyreOn,v.name) - break - end + if bsk:IdIsInList(id,v) then + tinsert(listsTheyreOn,v.name) + break end end if getn(listsTheyreOn) > 0 then @@ -505,7 +503,7 @@ function bsk:DoRemovePersonFromList(change)--{{{ local list = bsk.lists[change.arg.listIndex] - for i,v in pairs(list) do + for i,v in ipairs(list) do if v.id == change.arg.id then table.remove(list,i) break @@ -518,6 +516,7 @@ function bsk:RemovePersonFromList(name,listName)--{{{ local listIndex = bsk:GetListIndex(listName) local pid = personName2id[name] + -- todo: check that they're on the list in the first place local change = {action="RemovePersonFromList",arg={id=pid,listIndex=listIndex}} bsk:StartChange(change) if bsk:DoRemovePersonFromList(change) then @@ -576,6 +575,7 @@ end -- TODO: batch into a single op - no need to spam 25 messages in a row end + function bsk:PopulateListRandom(listIndex) -- difference (raid+reserve)-list, then random shuffle that, then add bsk:PopulateRaidList()