【轩辕宝镜】修复只上阵了满足条件的神将,没有补位的问题
parent
c8c003abb7
commit
07a96a88e4
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue