一键升级bug修改

dev_chengFeng
yuanshuai 2022-11-23 15:28:32 +08:00
parent bfd7967d52
commit 3c2e86f97c
1 changed files with 7 additions and 6 deletions

View File

@ -1028,18 +1028,19 @@ function RoleInfoLayout:CalUpMaxLv()
local upMaxCostList={}
for i = curHeroData.lv, this.GetCurHeroLvLimit() do
local costList=ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, i).Consume
for i = 1, #costList do
local costxxId=costList[i][1]
local costxxNum=costList[i][2]
for j = 1, #costList do
local costxxId=costList[j][1]
local costxxNum=costList[j][2]
if upMaxCostList[costxxId] then
costxxNum=costxxNum+upMaxCostList[costxxId]
end
local havexxNum= BagManager.GetItemCountById(costList[i][1])
if havexxNum<costxxNum then
local havexxNum= BagManager.GetItemCountById(costList[j][1])
if havexxNum<costxxNum or calOldLv==this.GetCurHeroLvLimit() then
return calOldLv
end
upMaxCostList[costxxId]=costxxNum
end
calOldLv=i
calOldLv=i+1
end
return calOldLv
end