diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 875bf4e..13c2896 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -528,14 +528,19 @@ function _M.saleItemRpc(agent, data) local role = agent.role local msg = MsgPack.unpack(data) local backs = msg.backs - if not backs then return end + if not backs or not next(backs) then return 0 end + + for itemId, count in pairs(backs) do + if math.illegalNum(count, 1, role:getItemCount(itemId)) then return 1 end + if globalCsv.unit_paster_ban[itemId] then return 2 end + local itemData = csvdb["itemCsv"][itemId] + if itemData.sell_effect == "" then return 3 end + end local reward = {} local fragCount = 0 for itemId, count in pairs(backs) do - if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end local itemData = csvdb["itemCsv"][itemId] - if itemData.sell_effect == "" then return end if itemData.type == ItemType.HeroFragment or itemData.type == ItemType.HeroFCommon then fragCount = fragCount + count end -- libgit2 0.21.2