From cc87434b1cfe63349590b2b4e55c6307bee2f89c Mon Sep 17 00:00:00 2001 From: chenyueqi <1056825054@qq.com> Date: Tue, 11 Feb 2020 15:28:31 +0800 Subject: [PATCH] 时钟箱拆解 --- src/actions/RoleAction.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 113e93b..dac2418 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -443,7 +443,7 @@ function _M.openTimeBoxRpc(agent, data) if math.illegalNum(slot, 1, role:getFuncLv(FuncOpenType.TimeBoxSlot)) then return end local boxL = role:getProperty("boxL") - local reward + local reward = {} if oper == 1 then -- 打开 local itemId = msg.itemId if role:getItemCount(itemId) < 1 then return end @@ -497,8 +497,8 @@ function _M.openTimeBoxRpc(agent, data) if gemId ~= 0 and next(selectGift) then randomNum = randomNum - 1 - local idx = math.randWeight(pool, 3) - reward[pool[idx][1]] = (reward[pool[idx][1]] or 0) + pool[idx][2] + local idx = math.randWeight(selectGift, 3) + reward[selectGift[idx][1]] = (reward[selectGift[idx][1]] or 0) + selectGift[idx][2] end local needCount = math.min(#pool, randomNum) @@ -509,7 +509,6 @@ function _M.openTimeBoxRpc(agent, data) end end - boxL[slot] = nil reward = role:award(reward) role:checkTaskEnter("OpenBox") -- libgit2 0.21.2