Commit 848695d1f27d1a2cf21a49e63271a66ff129e447
1 parent
efc1452c
枚举索引错误
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
src/actions/RoleAction.lua
@@ -1407,16 +1407,16 @@ function _M.diamondConvertRpc(agent, data) | @@ -1407,16 +1407,16 @@ function _M.diamondConvertRpc(agent, data) | ||
1407 | if role:getAllDiamond() < cost then return 2 end | 1407 | if role:getAllDiamond() < cost then return 2 end |
1408 | 1408 | ||
1409 | local get = globalCsv.legal_tender_cost * cost | 1409 | local get = globalCsv.legal_tender_cost * cost |
1410 | - role:costDiamond({count = cost, log = {desc = "convert", int1 = ItemType.Jade, int2 = get}}) | 1410 | + role:costDiamond({count = cost, log = {desc = "convert", int1 = ItemId.Jade, int2 = get}}) |
1411 | local reward, change | 1411 | local reward, change |
1412 | if oper == 1 then -- 钻石兑换成虹光玉 | 1412 | if oper == 1 then -- 钻石兑换成虹光玉 |
1413 | reward, change = role:award({[ItemId.Jade] = get}, {log = {desc = "convert"}}) | 1413 | reward, change = role:award({[ItemId.Jade] = get}, {log = {desc = "convert"}}) |
1414 | elseif oper == 2 then -- 钻石兑换成虹光玉再兑换成招募券 | 1414 | elseif oper == 2 then -- 钻石兑换成虹光玉再兑换成招募券 |
1415 | local allReward = {[ItemId.Jade] = get} | 1415 | local allReward = {[ItemId.Jade] = get} |
1416 | local quan = math.floor(get/globalCsv.recruit_cost) | 1416 | local quan = math.floor(get/globalCsv.recruit_cost) |
1417 | - allReward[ItemType.Jade] = allReward[ItemType.Jade] - quan * globalCsv.recruit_cost | ||
1418 | - if allReward[ItemType.Jade] == 0 then | ||
1419 | - allReward[ItemType.Jade] = nil | 1417 | + allReward[ItemId.Jade] = allReward[ItemId.Jade] - quan * globalCsv.recruit_cost |
1418 | + if allReward[ItemId.Jade] == 0 then | ||
1419 | + allReward[ItemId.Jade] = nil | ||
1420 | end | 1420 | end |
1421 | if quan > 0 then | 1421 | if quan > 0 then |
1422 | allReward[ItemId.RecruitmentCard] = quan | 1422 | allReward[ItemId.RecruitmentCard] = quan |