This commit is contained in:
xiekaidong 2023-05-22 18:13:19 +08:00
parent 1ab896c46b
commit 20bf29490f

View File

@ -145,8 +145,8 @@ function BattleData:refreshBoard(board, blockIcon)
local posId = ModuleManager.BattleManager:getPosId(r, c) local posId = ModuleManager.BattleManager:getPosId(r, c)
local data = { local data = {
posId = posId, posId = posId,
gridType = info[1], gridType = info[1] or BattleConst.GRID_TYPE.EMPTY,
elementType = info[2] elementType = info[2] or BattleConst.ELEMENT_TYPE.RED
} }
if self.gridEntities[data.posId] then if self.gridEntities[data.posId] then
self.gridEntities[data.posId]:clear() self.gridEntities[data.posId]:clear()
@ -183,6 +183,8 @@ function BattleData:getElementTypeMap()
for posId, entity in pairs(self.gridEntities) do for posId, entity in pairs(self.gridEntities) do
if entity:canLink() then if entity:canLink() then
local elementType = entity:getElementType() local elementType = entity:getElementType()
Logger.logHighlight(posId)
Logger.logHighlight(elementType)
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1 elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
end end
end end