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