# HG changeset patch # User John@Yosemite-PC # Date 1331501251 14400 # Node ID eb3a3f69559e7a6d802932fd64f1d3743c3e5df0 # Parent 611808dbc0c073de8eda1cfd81d79205ecedc1c7 Command to remove person Disallow removing someone who is still on a list somewhere diff -r 611808dbc0c0 -r eb3a3f69559e Core.lua --- a/Core.lua Sat Mar 10 17:21:48 2012 -0500 +++ b/Core.lua Sun Mar 11 17:27:31 2012 -0400 @@ -79,6 +79,9 @@ end local person = FixPersonName(param[3]) bsk:RemovePersonFromList(person, param[4]) + elseif param[2] == "person" then + local person = FixPersonName(param[3]) + bsk:RemovePerson(person) else bsk:Print(sformat("Deleting anything of type %s is not supported",param[2])) end diff -r 611808dbc0c0 -r eb3a3f69559e Lists.lua --- a/Lists.lua Sat Mar 10 17:21:48 2012 -0500 +++ b/Lists.lua Sun Mar 11 17:27:31 2012 -0400 @@ -422,9 +422,23 @@ bsk:Print(sformat("%s is not in the persons list, please check your spelling", name)) return false end + 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 + end + end + if getn(listsTheyreOn) > 0 then + self:Print(sformat("Cannot remove person %s because they are on one or more lists (%s)",name,table.concat(listsTheyreOn,", "))) + return false + end local change = {action="RemovePerson",arg={id=id}} bsk:StartChange(change) - if bsk:DoRemovePerson() then + if bsk:DoRemovePerson(change) then bsk:CommitChange(change) end end--}}}