Commit 064138fee2a7b7a1e3dd2f36336ab9ba06640c48
1 parent
2dbe4fb9
定制礼包相关bug修复
Showing
1 changed file
with
4 additions
and
6 deletions
Show diff stats
src/models/RolePlugin.lua
| ... | ... | @@ -2035,7 +2035,6 @@ function RolePlugin.bind(Role) |
| 2035 | 2035 | if limit ~= 0 and limit <= (rechargeRecord[rechargeId] or 0) then |
| 2036 | 2036 | return "" |
| 2037 | 2037 | end |
| 2038 | - | |
| 2039 | 2038 | -- 检查礼包自选奖励合法 |
| 2040 | 2039 | if choose and choose ~= "" then |
| 2041 | 2040 | if rechargeData.itemgift == "" then return "" end |
| ... | ... | @@ -2043,10 +2042,10 @@ function RolePlugin.bind(Role) |
| 2043 | 2042 | local set = choose:toTableArray(true) |
| 2044 | 2043 | if slot ~= #set then return "" end |
| 2045 | 2044 | local pass = {} |
| 2046 | - local groups = rechargeData.itemdirect:toTableArray(true) | |
| 2047 | - for _, item in ipairs(set) do | |
| 2045 | + local groups = rechargeData.itemgift:toTableArray(true) | |
| 2046 | + for idx, item in ipairs(set) do | |
| 2048 | 2047 | for _, group in ipairs(groups) do |
| 2049 | - if group[2] == item[1] and group[3] == item[2] then | |
| 2048 | + if group[2] == item[1] and group[3] == item[2] and idx == group[1] then | |
| 2050 | 2049 | pass[group[1]] = 1 |
| 2051 | 2050 | break |
| 2052 | 2051 | end |
| ... | ... | @@ -2054,7 +2053,6 @@ function RolePlugin.bind(Role) |
| 2054 | 2053 | end |
| 2055 | 2054 | if #pass ~= slot then return "" end |
| 2056 | 2055 | end |
| 2057 | - | |
| 2058 | 2056 | --判断是否是活动商品 |
| 2059 | 2057 | if rechargeData.activity_id ~= 0 then |
| 2060 | 2058 | local actCfg = csvdb["activity_ctrlCsv"][rechargeData.activity_id] |
| ... | ... | @@ -2242,7 +2240,7 @@ function RolePlugin.bind(Role) |
| 2242 | 2240 | for itemId, value in pairs(tReward) do |
| 2243 | 2241 | reward[itemId] = (reward[itemId] or 0) + value |
| 2244 | 2242 | end |
| 2245 | - for itemId, value in pairs(tChange) do | |
| 2243 | + for itemId, value in pairs(tChange or {}) do | |
| 2246 | 2244 | reward[itemId] = (reward[itemId] or 0) + value |
| 2247 | 2245 | end |
| 2248 | 2246 | end | ... | ... |