英雄排序bug修复

This commit is contained in:
xiekaidong 2023-04-23 15:48:52 +08:00
parent 5dd14eb4db
commit cc0eebfad8

View File

@ -122,18 +122,21 @@ function HeroComp:sortHeroList()
local heroEntity = HeroData:getHeroById(info.cfgId)
local sort = info.cfgId -- id 预留6位
sort = sort + (10 - info.elementType) * 1000000 -- 位置预留1位
sort = sort + 10000000 * heroEntity:getQlt() -- 品质1位
sort = sort + 100000000 * heroEntity:getLv() -- 预留3位
if heroEntity:isUnlock() then
sort = sort + 30000000
sort = sort + 300000000000
if heroEntity:isActived() then
sort = sort + 400000000000
else
sort = sort + 300000000000
end
elseif DataManager.BagData.ItemData:getItemNumById(heroEntity:getFragmentId()) > 0 then
sort = sort + 20000000
sort = sort + 200000000000
else
sort = sort + 10000000
sort = sort + 100000000000
end
sort = sort + 100000000 * heroEntity:getQlt() -- 品质1位
sort = sort + 1000000000 * heroEntity:getLv() -- 预留3位
info.sort = sort
end
table.sort(self.heroList, function(a, b)