一键升级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={} local upMaxCostList={}
for i = curHeroData.lv, this.GetCurHeroLvLimit() do for i = curHeroData.lv, this.GetCurHeroLvLimit() do
local costList=ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, i).Consume local costList=ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, i).Consume
for i = 1, #costList do for j = 1, #costList do
local costxxId=costList[i][1] local costxxId=costList[j][1]
local costxxNum=costList[i][2] local costxxNum=costList[j][2]
if upMaxCostList[costxxId] then if upMaxCostList[costxxId] then
costxxNum=costxxNum+upMaxCostList[costxxId] costxxNum=costxxNum+upMaxCostList[costxxId]
end end
local havexxNum= BagManager.GetItemCountById(costList[i][1]) local havexxNum= BagManager.GetItemCountById(costList[j][1])
if havexxNum<costxxNum then if havexxNum<costxxNum or calOldLv==this.GetCurHeroLvLimit() then
return calOldLv return calOldLv
end end
upMaxCostList[costxxId]=costxxNum
end end
calOldLv=i calOldLv=i+1
end end
return calOldLv return calOldLv
end end