Commit 4aadc4504a9f65c884b69b5a4d32e6343fdf7cd1
1 parent
1fc9c12a
切换拆解术式bug,造成获得巨大数量的物品
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
src/actions/RoleAction.lua
| ... | ... | @@ -586,9 +586,9 @@ function _M.openTimeBoxRpc(agent, data) |
| 586 | 586 | else |
| 587 | 587 | local oldId, process, time = boxL[slot].id, boxL[slot].process, boxL[slot].time |
| 588 | 588 | local unitTime = globalCsv.box_key_time[oldId] * 60 |
| 589 | - local doneCnt = math.floor((process + skynet.timex() - time) / unitTime) | |
| 589 | + local doneCnt = time == 0 and 0 or math.floor((process + skynet.timex() - time) / unitTime) | |
| 590 | 590 | if doneCnt > 0 then |
| 591 | - reward = role:award({[oldId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot}}) | |
| 591 | + reward = role:award({[oldId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) | |
| 592 | 592 | end |
| 593 | 593 | end |
| 594 | 594 | local limit = globalCsv.box_key_max[itemId] or 5 |
| ... | ... | @@ -610,7 +610,7 @@ function _M.openTimeBoxRpc(agent, data) |
| 610 | 610 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") |
| 611 | 611 | local costKey = math.ceil((stopTime - nowTime) / (cost_pre[1] * 60)) * cost_pre[2] |
| 612 | 612 | if not role:checkItemEnough({[ItemId.Diamond] = costKey}) then return 5 end |
| 613 | - role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot}}) | |
| 613 | + role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) | |
| 614 | 614 | else |
| 615 | 615 | stopTime = math.min(nowTime,time + globalCsv.box_productLine_time * 3600) |
| 616 | 616 | end |
| ... | ... | @@ -618,7 +618,7 @@ function _M.openTimeBoxRpc(agent, data) |
| 618 | 618 | |
| 619 | 619 | local doneCnt = math.floor((process + stopTime - time) / unitTime) |
| 620 | 620 | if doneCnt > 0 then |
| 621 | - reward = role:award({[itemId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot}}) | |
| 621 | + reward = role:award({[itemId] = doneCnt}, {log = {desc = "openTimeBox", int1 = slot, int2 = oper}}) | |
| 622 | 622 | end |
| 623 | 623 | if role:getItemCount(itemId) >= globalCsv.box_key_max[itemId] then |
| 624 | 624 | nowTime = 0 |
| ... | ... | @@ -687,7 +687,7 @@ function _M.openTimeBoxRpc(agent, data) |
| 687 | 687 | reward[id] = (reward[id] or 0) + num |
| 688 | 688 | end |
| 689 | 689 | end |
| 690 | - reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = costId}}) | |
| 690 | + reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = costId, int2 = oper}}) | |
| 691 | 691 | else |
| 692 | 692 | return |
| 693 | 693 | end | ... | ... |