Commit f07252a224b79308926c2d4f424a9e2f384e31dc
1 parent
18a3955b
fix: 修复 魔导师兑换虹光玉兑换招募券的过程中,未消耗虹光玉。02
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
src/actions/RoleAction.lua
| @@ -1532,6 +1532,8 @@ function _M.diamondConvertRpc(agent, data) | @@ -1532,6 +1532,8 @@ function _M.diamondConvertRpc(agent, data) | ||
| 1532 | 1532 | ||
| 1533 | local oper = msg.oper | 1533 | local oper = msg.oper |
| 1534 | if oper ~= 1 and oper ~= 2 then return 0 end | 1534 | if oper ~= 1 and oper ~= 2 then return 0 end |
| 1535 | + print("oper: ") | ||
| 1536 | + print(oper) | ||
| 1535 | 1537 | ||
| 1536 | local cost = math.ceil(msg.cost or 0) | 1538 | local cost = math.ceil(msg.cost or 0) |
| 1537 | if cost <= 0 then return 1 end | 1539 | if cost <= 0 then return 1 end |
| @@ -1549,6 +1551,7 @@ function _M.diamondConvertRpc(agent, data) | @@ -1549,6 +1551,7 @@ function _M.diamondConvertRpc(agent, data) | ||
| 1549 | local quan = math.floor(get/globalCsv.recruit_cost) | 1551 | local quan = math.floor(get/globalCsv.recruit_cost) |
| 1550 | local remain = get - quan * globalCsv.recruit_cost | 1552 | local remain = get - quan * globalCsv.recruit_cost |
| 1551 | 1553 | ||
| 1554 | + print("get: " .. get .. "; old: " .. old .. "; remain: " .. remain) | ||
| 1552 | local allReward = {} | 1555 | local allReward = {} |
| 1553 | if remain > old then | 1556 | if remain > old then |
| 1554 | allReward[ItemId.Jade] = remain - old | 1557 | allReward[ItemId.Jade] = remain - old |
| @@ -1556,11 +1559,13 @@ function _M.diamondConvertRpc(agent, data) | @@ -1556,11 +1559,13 @@ function _M.diamondConvertRpc(agent, data) | ||
| 1556 | elseif remain == old then | 1559 | elseif remain == old then |
| 1557 | else | 1560 | else |
| 1558 | role:costItems({[ItemId.Jade] = old - remain}, {log = {desc = "convert", short1=oper}}) | 1561 | role:costItems({[ItemId.Jade] = old - remain}, {log = {desc = "convert", short1=oper}}) |
| 1562 | + role:checkWorldChangePoints({[ItemWorldLine.CostJade]= quan * globalCsv.recruit_cost - (old - remain)}) | ||
| 1559 | end | 1563 | end |
| 1560 | 1564 | ||
| 1561 | if quan > 0 then | 1565 | if quan > 0 then |
| 1562 | allReward[ItemId.RecruitmentCard] = quan | 1566 | allReward[ItemId.RecruitmentCard] = quan |
| 1563 | end | 1567 | end |
| 1568 | + dump(allReward) | ||
| 1564 | 1569 | ||
| 1565 | reward, change = role:award(allReward, {log = {desc = "convert"}}) | 1570 | reward, change = role:award(allReward, {log = {desc = "convert"}}) |
| 1566 | end | 1571 | end |