【轩辕宝镜】修复只上阵了满足条件的神将,没有补位的问题

dev_chengFeng
gaoxin 2021-09-27 17:13:48 +08:00
parent c8c003abb7
commit 07a96a88e4
1 changed files with 18 additions and 0 deletions

View File

@ -70,9 +70,27 @@ function this.GetOneKeyUpHeroList()
end
end)
-- 限制数量
local upList = {}
for k, v in ipairs(tempHeros) do
if #heros < rulesNum then
table.insert(heros, v)
upList[v.dynamicId] = 1
end
end
-- 所有英雄,按战力补位
local allHeros = this.GetHeroList()
table.sort(allHeros,function(a,b)
if a.warPower == b.warPower then
return a.id > b.id
else
return a.warPower > b.warPower
end
end)
for k, v in ipairs(allHeros) do
if not upList[v.dynamicId] then
if #heros < 6 then
table.insert(heros, v)
end
end
end
return heros