挂机卡死修改提交

dev_chengFeng
jiaoyangna 2021-06-11 10:48:11 +08:00
parent e89a0d26c8
commit ed4472a298
1 changed files with 13 additions and 3 deletions

View File

@ -953,8 +953,17 @@ function this.RandomFirendNPC(currankAllList)
-- ----LogGreen("friend "..currankAllList[playerRandomNum].userName) -- ----LogGreen("friend "..currankAllList[playerRandomNum].userName)
end end
end end
local currankAllList = {}
function this.RandomNPC(currankAllList,curlist) function this.RandomNPC(_currankAllList,curlist)
if _currankAllList then
currankAllList = {}
for i = 1,#_currankAllList do
table.insert(currankAllList,currankAllList[i])
end
end
if not currankAllList or #currankAllList < 1 then
return
end
local playerRandomNum = math.random(1, #currankAllList) local playerRandomNum = math.random(1, #currankAllList)
local uid = 0 local uid = 0
if currankAllList[playerRandomNum].id then if currankAllList[playerRandomNum].id then
@ -965,7 +974,8 @@ function this.RandomNPC(currankAllList,curlist)
uid = currankAllList[playerRandomNum].uid uid = currankAllList[playerRandomNum].uid
end end
if curlist[uid] or uid < 1 then if curlist[uid] or uid < 1 then
this.RandomNPC(currankAllList,curlist) table.remove(currankAllList,playerRandomNum)
this.RandomNPC(nil,curlist)
else else
curlist[uid] = {} curlist[uid] = {}
curlist[uid] = currankAllList[playerRandomNum] curlist[uid] = currankAllList[playerRandomNum]