From a526f9ef82f28972140a7c34b9dda2a90c59bc48 Mon Sep 17 00:00:00 2001 From: liuzujun <307836273@qq.com> Date: Thu, 17 Sep 2020 17:16:49 +0800 Subject: [PATCH] 奖励关卡活动未开启导致Bug --- src/actions/HangAction.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index be31860..12c1ed9 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -483,9 +483,11 @@ function _M.buyBonusCountRpc(agent, data) if not TimeReset["DailyBattle" .. btype] then return end local open, actId = role.activity:isOpen("BonusDouble") local actData = csvdb["activity_ctrlCsv"][actId] - if not actData then return end - local coef = open and tonumber(actData.condition2) or 1 + local coef = 1 + if open and actData then + coef= tonumber(actData.condition2) + end local bonusC = role.dailyData:getProperty("bonusC") bonusC[btype] = bonusC[btype] or {c = 0, b = 0} @@ -528,9 +530,11 @@ function _M.startBonusBattleRpc(agent, data) bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} local actData = csvdb["activity_ctrlCsv"][actId] - if not actData then return 6 end - local coef = open and tonumber(actData.condition2) or 1 + local coef = 1 + if open and actData then + coef = tonumber(actData.condition2) + end if globalCsv.bonus_daily_count * coef - bonusC[bonusData.type]["c"] <= 0 then return 7 end @@ -552,9 +556,11 @@ function _M.endBonusBattleRpc(agent, data) if not role.__bonusBattleCache then return 1 end local open, actId = role.activity:isOpen("BonusDouble") local actData = csvdb["activity_ctrlCsv"][actId] - if not actData then return end - local coef = open and tonumber(actData.condition2) or 1 + local coef = 1 + if open and actData then + coef = tonumber(actData.condition2) + end if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) -- libgit2 0.21.2