一个容错

This commit is contained in:
xiekaidong 2023-08-14 11:15:21 +08:00
parent a1a13036c9
commit c94018809f

View File

@ -69,7 +69,11 @@ function BattleSnapshotHelper:snapshotBattleInfo(battleBaseController)
battleBaseController.snapShotInfo.gridEdge = gridEdge battleBaseController.snapShotInfo.gridEdge = gridEdge
-- 血量 -- 血量
battleBaseController.snapShotInfo.hpPercent = battleBaseController.battleData.atkTeam:getHpPercent() if battleBaseController.battleData.atkTeam:getMaxHp() <= 0 then
battleBaseController.snapShotInfo.hpPercent = 0 -- 容错
else
battleBaseController.snapShotInfo.hpPercent = battleBaseController.battleData.atkTeam:getHpPercent()
end
-- 技能 -- 技能
battleBaseController.snapShotInfo.atkSkillMap = table.clearOrCreate(battleBaseController.snapShotInfo.atkSkillMap) battleBaseController.snapShotInfo.atkSkillMap = table.clearOrCreate(battleBaseController.snapShotInfo.atkSkillMap)