From 4aadc4504a9f65c884b69b5a4d32e6343fdf7cd1 Mon Sep 17 00:00:00 2001 From: chenyueqi Date: Fri, 15 Jan 2021 17:57:10 +0800 Subject: [PATCH] 切换拆解术式bug,造成获得巨大数量的物品 --- src/actions/RoleAction.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 392f485..5cb76f5 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -586,9 +586,9 @@ function _M.openTimeBoxRpc(agent, data) else local oldId, process, time = boxL[slot].id, boxL[slot].process, boxL[slot].time local unitTime = globalCsv.box_key_time[oldId] * 60 - local doneCnt = math.floor((process + skynet.timex() - time) / unitTime) + local doneCnt = time == 0 and 0 or math.floor((process + skynet.timex() - time) / unitTime) if doneCnt > 0 then - reward = role:award({[oldId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot}}) + reward = role:award({[oldId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) end end local limit = globalCsv.box_key_max[itemId] or 5 @@ -610,7 +610,7 @@ function _M.openTimeBoxRpc(agent, data) local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") local costKey = math.ceil((stopTime - nowTime) / (cost_pre[1] * 60)) * cost_pre[2] if not role:checkItemEnough({[ItemId.Diamond] = costKey}) then return 5 end - role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot}}) + role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) else stopTime = math.min(nowTime,time + globalCsv.box_productLine_time * 3600) end @@ -618,7 +618,7 @@ function _M.openTimeBoxRpc(agent, data) local doneCnt = math.floor((process + stopTime - time) / unitTime) if doneCnt > 0 then - reward = role:award({[itemId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot}}) + reward = role:award({[itemId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) end if role:getItemCount(itemId) >= globalCsv.box_key_max[itemId] then nowTime = 0 @@ -687,7 +687,7 @@ function _M.openTimeBoxRpc(agent, data) reward[id] = (reward[id] or 0) + num end end - reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = costId}}) + reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = costId, int2 = oper}}) else return end -- libgit2 0.21.2