From c94018809fd1f9b550e1b5c5e0002224bb7f789a Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Mon, 14 Aug 2023 11:15:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/helper/battle_snapshot_helper.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/app/module/battle/helper/battle_snapshot_helper.lua b/lua/app/module/battle/helper/battle_snapshot_helper.lua index f846cf4f..ad0f028b 100644 --- a/lua/app/module/battle/helper/battle_snapshot_helper.lua +++ b/lua/app/module/battle/helper/battle_snapshot_helper.lua @@ -69,7 +69,11 @@ function BattleSnapshotHelper:snapshotBattleInfo(battleBaseController) 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)