增加容错

This commit is contained in:
xiekaidong 2023-04-23 09:55:01 +08:00
parent f6b7f954c2
commit c2bfaf937f
2 changed files with 8 additions and 3 deletions

View File

@ -314,6 +314,7 @@ function BattleData:setGridInfo(posId, gridInfo)
end
entity:setSkilId() -- 清除skillId
entity:determineIdleStatus()
end
function BattleData:getSkillEntities()

View File

@ -11,9 +11,7 @@ function BattleGridEntity:ctor(data)
self.linkSkillCount = data.linkSkillCount or 0 -- 任意链接技能激活次数
self.isIdle = false
self.data.isDirty = false
if self.gridType == BattleConst.GRID_TYPE.EMPTY and self.elementType == BattleConst.ELEMENT_TYPE.NONE then
self.isIdle = true
end
self:determineIdleStatus()
end
function BattleGridEntity:clear()
@ -228,4 +226,10 @@ function BattleGridEntity:getLinkSkillCount()
return self.linkSkillCount
end
function BattleGridEntity:determineIdleStatus()
if not self.isIdle and self.gridType == BattleConst.GRID_TYPE.EMPTY and self.elementType == BattleConst.ELEMENT_TYPE.NONE then
self.isIdle = true
end
end
return BattleGridEntity