From 84f22f612392525bae78ff7c6545e3e2101667dd Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 10 Aug 2023 17:33:30 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battle/controller/battle_base_controller.lua | 15 +++++++++++---- .../battle/helper/battle_snapshot_helper.lua | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index ee39b0c5..23391c9a 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -925,7 +925,7 @@ function BattleBaseController:enterNextWaveBySnapshot(snapShot) self.curWaveMonsterDead = false self:refreshWave(self.waveIndex) self.needWaitingBoardOver = true - self:generateBoard(true, snapShot.boardSnapInfo) + self:generateBoard(true, snapShot) self.waveDurationTime = 0 self.eliminateCount = 0 @@ -1537,9 +1537,13 @@ function BattleBaseController:onFillBoardOver(isRoundBeginCheck) local index = table.remove(self.showMysteryBoxIndexs, 1) local boardList, _, mysteryBoxIndexMap = self:getInitBoard() local rewards = mysteryBoxIndexMap[index] - ModuleManager.BattleManager:showBoxOpenUI(rewards, function() + if rewards then + ModuleManager.BattleManager:showBoxOpenUI(rewards, function() + self:onFillBoardOver() + end) + else self:onFillBoardOver() - end) + end return end @@ -1620,6 +1624,9 @@ function BattleBaseController:generateBoard(isFirst, snapshot) end self.curBoardIndex = (self.curBoardIndex or 0) + 1 + if snapshot and snapshot.curBoardIndex then + self.curBoardIndex = snapshot.curBoardIndex + end if not boardList[self.curBoardIndex] then -- 容错 if isFirst then self.needWaitingBoardOver = false @@ -1632,7 +1639,7 @@ function BattleBaseController:generateBoard(isFirst, snapshot) board = mysteryBoard end self.battleUI:switchBoard(function() - self.battleData:refreshBoard(board, self:getBlockIcon(), snapshot) + self.battleData:refreshBoard(board, self:getBlockIcon(), snapshot and snapshot.boardSnapInfo) self.battleUI:initGridCell(function() if isFirst then self.needWaitingBoardOver = false diff --git a/lua/app/module/battle/helper/battle_snapshot_helper.lua b/lua/app/module/battle/helper/battle_snapshot_helper.lua index 72c5d81a..94cc9fb5 100644 --- a/lua/app/module/battle/helper/battle_snapshot_helper.lua +++ b/lua/app/module/battle/helper/battle_snapshot_helper.lua @@ -50,6 +50,7 @@ function BattleSnapshotHelper:snapshotBattleInfo(battleBaseController) for k, v in pairs(battleBaseController.lastRoundBreakedGridType) do battleBaseController.snapShotInfo.lastRoundBreakedGridType[tostring(k)] = v end + battleBaseController.snapShotInfo.curBoardIndex = battleBaseController.curBoardIndex battleBaseController.snapShotInfo.chapterId = battleBaseController.chapterId -- 当前战斗关卡 battleBaseController.snapShotInfo.waveIndex = battleBaseController.waveIndex -- 当前波次 battleBaseController.snapShotInfo.gotMysteryBoxIndexs = table.clearOrCreate(battleBaseController.snapShotInfo.gotMysteryBoxIndexs) -- 神秘宝箱索引