礼物添加空判断

onepiece_demo_arena
wangzhenxing 2023-12-14 17:21:02 +08:00
parent 25dc5ca5a9
commit 8c0dd3a9b0
1 changed files with 2 additions and 2 deletions

View File

@ -194,7 +194,7 @@ function this.GetHeroPotencyLvById(did)
if this.playerGifts and #this.playerGifts>0 then
for i=1,#this.playerGifts do
local id=this.playerGifts[i]
if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew>0 then
if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew>0 and type(equipConfig[id].PotentialNew[1])~="userdata" then
lv=lv+equipConfig[id].PotentialNew[2]
end
end
@ -203,7 +203,7 @@ function this.GetHeroPotencyLvById(did)
local list=this.allHeroGifts[did]
for i=1,#list do
local id=list[i]
if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew>0 then
if equipConfig[id] and equipConfig[id].PotentialNew and #equipConfig[id].PotentialNew>0 and type(equipConfig[id].PotentialNew[1])~="userdata" then
lv=lv+equipConfig[id].PotentialNew[2]
end
end