【NPC】去重

dev_chengFeng
zhangqiang 2021-01-28 15:27:37 +08:00
parent 0a9d0d2d05
commit ba6db73270
1 changed files with 11 additions and 1 deletions

View File

@ -550,7 +550,17 @@ function this.GetMainPlayerNPCData3(fun)
table.insert(upList,val)
end
for key,val in pairs(rankNPCList) do
table.insert(upList,val)
-- 去重
local isRepetition = false
for ke2y,val2 in pairs(upList) do
local curUid = val2.roleUid or val2.id
if val.uid == curUid then
isRepetition = true
end
end
if not isRepetition then
table.insert(upList,val)
end
end
if #upList < needAllNum then
for i = 1, needAllNum - #upList do