From a29a9606bf1e2151e3b0166a8c5a5db3f3938fc9 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 27 Oct 2023 16:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=81=E5=AE=9Abuff=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/controller/battle_base_controller.lua | 3 +-- lua/app/userdata/battle/battle_base_data.lua | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index 74bb7e5c..5ca9e9d4 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -1995,9 +1995,8 @@ function BattleBaseController:lockElement(lcokElementType, isUnlock) end if isUnlock then - self.battleData:cacheLockElement(lcokElementType, nil) + self.battleData:clearAllCacheLockElement(lcokElementType, nil) for elementType, list in pairs(self.lockElementMap) do - self.battleData:cacheLockElement(elementType, nil) for _, posId in ipairs(list) do self.battleData:setGridType(posId, BattleConst.GRID_TYPE.EMPTY) end diff --git a/lua/app/userdata/battle/battle_base_data.lua b/lua/app/userdata/battle/battle_base_data.lua index b9d0219a..1335c323 100644 --- a/lua/app/userdata/battle/battle_base_data.lua +++ b/lua/app/userdata/battle/battle_base_data.lua @@ -617,6 +617,10 @@ function BattleBaseData:getCacheLockedElement(elementType) return self.lockElementMap[elementType] end +function BattleBaseData:clearAllCacheLockElement() + self.lockElementMap = table.clearOrCreate(self.lockElementMap) +end + function BattleBaseData:cacheBoardSkill() self.cacheSkillList = {} self.cacheSkillCount = 0