From 20bf29490fa7bedcccdc24e35545b68ce94078f4 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 22 May 2023 18:13:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/userdata/battle/battle_data.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/app/userdata/battle/battle_data.lua b/lua/app/userdata/battle/battle_data.lua index c5ce9c2c..a97fd61a 100644 --- a/lua/app/userdata/battle/battle_data.lua +++ b/lua/app/userdata/battle/battle_data.lua @@ -145,8 +145,8 @@ function BattleData:refreshBoard(board, blockIcon) local posId = ModuleManager.BattleManager:getPosId(r, c) local data = { posId = posId, - gridType = info[1], - elementType = info[2] + gridType = info[1] or BattleConst.GRID_TYPE.EMPTY, + elementType = info[2] or BattleConst.ELEMENT_TYPE.RED } if self.gridEntities[data.posId] then self.gridEntities[data.posId]:clear() @@ -183,6 +183,8 @@ function BattleData:getElementTypeMap() for posId, entity in pairs(self.gridEntities) do if entity:canLink() then local elementType = entity:getElementType() + Logger.logHighlight(posId) + Logger.logHighlight(elementType) elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1 end end