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