From de16254cb0a42368abcc7e85470eedfd2f3423bd Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 11 Aug 2023 17:50:15 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/controller/battle_base_controller.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index 5c0bccb8..256c6ed4 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -343,8 +343,10 @@ function BattleBaseController:onLinkChange() end local elementTypeCount = 0 - for element, count in pairs(dmgElementTypeMap) do - elementTypeCount = elementTypeCount + count + if dmgElementTypeMap then + for element, count in pairs(dmgElementTypeMap) do + elementTypeCount = elementTypeCount + count + end end local dmg = self:calExpectedInjury(mainElementType, elementTypeCount, dmgSkillId) local defMainUnitcomp = self:getCurOtherActionUnitComp()