Commit 6e0a6d6b56af382866fa90d4bb62fcd510f82ced

Authored by zhangqijia
1 parent 6ad7e803

fix: 礼包兑换码奖励改回放入背包

Showing 2 changed files with 5 additions and 4 deletions   Show diff stats
src/actions/RoleAction.lua
... ... @@ -1369,11 +1369,12 @@ function _M.drawCodeRpc(agent, data)
1369 1369 if type(code) ~= "string" then return 1 end
1370 1370 if code:find("[^0-9a-zA-Z]") then return 2 end
1371 1371  
1372   - local ret, reward = role:getCodeGift(code)
  1372 + local ret, reward, change= role:getCodeGift(code)
1373 1373 if ret == 0 then
1374 1374 SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({
1375 1375 result = ret,
1376   - reward = reward:toNumMap(),
  1376 + reward = reward,
  1377 + change = change,
1377 1378 }))
1378 1379 return true
1379 1380 end
... ...
src/models/RolePlugin.lua
... ... @@ -3320,7 +3320,7 @@ function RolePlugin.bind(Role)
3320 3320 if ret == 0 then
3321 3321 local giftId = tonumber(result.giftId)
3322 3322 self:setProperty("codeStr", codestr:setv(giftId, 1))
3323   - self:sendMail(MailId.DrawCode, nil, result.gift)
  3323 + local reward, change = self:award(result.gift, {log = {desc = "drawCode", int1 = giftId}})
3324 3324  
3325 3325 self:log("get_gift", {
3326 3326 gift_id = giftId, -- 礼包ID
... ... @@ -3330,7 +3330,7 @@ function RolePlugin.bind(Role)
3330 3330 gift_reason = 0, -- 礼包发放原因,见发放原因枚举表
3331 3331 })
3332 3332 self:mylog("role_action", {desc = "drawCode", int1 = giftId, key1 = code, key2 = self:getRewardLogStr(result.gift)})
3333   - return ret, result.gift
  3333 + return ret, reward, change
3334 3334 end
3335 3335 -- 1 不存在的礼包码
3336 3336 -- 2 已经领取过相同类型物品
... ...