Commit a526f9ef82f28972140a7c34b9dda2a90c59bc48
1 parent
ee021c58
奖励关卡活动未开启导致Bug
Showing
1 changed file
with
12 additions
and
6 deletions
Show diff stats
src/actions/HangAction.lua
| @@ -483,9 +483,11 @@ function _M.buyBonusCountRpc(agent, data) | @@ -483,9 +483,11 @@ function _M.buyBonusCountRpc(agent, data) | ||
| 483 | if not TimeReset["DailyBattle" .. btype] then return end | 483 | if not TimeReset["DailyBattle" .. btype] then return end |
| 484 | local open, actId = role.activity:isOpen("BonusDouble") | 484 | local open, actId = role.activity:isOpen("BonusDouble") |
| 485 | local actData = csvdb["activity_ctrlCsv"][actId] | 485 | local actData = csvdb["activity_ctrlCsv"][actId] |
| 486 | - if not actData then return end | ||
| 487 | 486 | ||
| 488 | - local coef = open and tonumber(actData.condition2) or 1 | 487 | + local coef = 1 |
| 488 | + if open and actData then | ||
| 489 | + coef= tonumber(actData.condition2) | ||
| 490 | + end | ||
| 489 | 491 | ||
| 490 | local bonusC = role.dailyData:getProperty("bonusC") | 492 | local bonusC = role.dailyData:getProperty("bonusC") |
| 491 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} | 493 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} |
| @@ -528,9 +530,11 @@ function _M.startBonusBattleRpc(agent, data) | @@ -528,9 +530,11 @@ function _M.startBonusBattleRpc(agent, data) | ||
| 528 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} | 530 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} |
| 529 | 531 | ||
| 530 | local actData = csvdb["activity_ctrlCsv"][actId] | 532 | local actData = csvdb["activity_ctrlCsv"][actId] |
| 531 | - if not actData then return 6 end | ||
| 532 | 533 | ||
| 533 | - local coef = open and tonumber(actData.condition2) or 1 | 534 | + local coef = 1 |
| 535 | + if open and actData then | ||
| 536 | + coef = tonumber(actData.condition2) | ||
| 537 | + end | ||
| 534 | 538 | ||
| 535 | if globalCsv.bonus_daily_count * coef - bonusC[bonusData.type]["c"] <= 0 then return 7 end | 539 | if globalCsv.bonus_daily_count * coef - bonusC[bonusData.type]["c"] <= 0 then return 7 end |
| 536 | 540 | ||
| @@ -552,9 +556,11 @@ function _M.endBonusBattleRpc(agent, data) | @@ -552,9 +556,11 @@ function _M.endBonusBattleRpc(agent, data) | ||
| 552 | if not role.__bonusBattleCache then return 1 end | 556 | if not role.__bonusBattleCache then return 1 end |
| 553 | local open, actId = role.activity:isOpen("BonusDouble") | 557 | local open, actId = role.activity:isOpen("BonusDouble") |
| 554 | local actData = csvdb["activity_ctrlCsv"][actId] | 558 | local actData = csvdb["activity_ctrlCsv"][actId] |
| 555 | - if not actData then return end | ||
| 556 | 559 | ||
| 557 | - local coef = open and tonumber(actData.condition2) or 1 | 560 | + local coef = 1 |
| 561 | + if open and actData then | ||
| 562 | + coef = tonumber(actData.condition2) | ||
| 563 | + end | ||
| 558 | 564 | ||
| 559 | if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then | 565 | if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then |
| 560 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) | 566 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) |