挂机卡死修改提交
parent
e89a0d26c8
commit
ed4472a298
|
@ -953,8 +953,17 @@ function this.RandomFirendNPC(currankAllList)
|
|||
-- ----LogGreen("friend "..currankAllList[playerRandomNum].userName)
|
||||
end
|
||||
end
|
||||
|
||||
function this.RandomNPC(currankAllList,curlist)
|
||||
local currankAllList = {}
|
||||
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 uid = 0
|
||||
if currankAllList[playerRandomNum].id then
|
||||
|
@ -965,7 +974,8 @@ function this.RandomNPC(currankAllList,curlist)
|
|||
uid = currankAllList[playerRandomNum].uid
|
||||
end
|
||||
if curlist[uid] or uid < 1 then
|
||||
this.RandomNPC(currankAllList,curlist)
|
||||
table.remove(currankAllList,playerRandomNum)
|
||||
this.RandomNPC(nil,curlist)
|
||||
else
|
||||
curlist[uid] = {}
|
||||
curlist[uid] = currankAllList[playerRandomNum]
|
||||
|
|
Loading…
Reference in New Issue