From 64122b61fc47951356a69405d5efec7b4c764b09 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 13 May 2021 00:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3rnd=E5=87=BA=E5=9D=97?= =?UTF-8?q?=E7=AE=97=E6=B3=95=E7=9A=84=E4=B8=80=E7=82=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/seqGenerators.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/parts/player/seqGenerators.lua b/parts/player/seqGenerators.lua index f163b747..86ef00b1 100644 --- a/parts/player/seqGenerators.lua +++ b/parts/player/seqGenerators.lua @@ -125,20 +125,21 @@ local seqGenerators={ end end, rnd=function(P,seq0) - P:getNext(seq0[P:RND(#seq0)]) - while true do - while #P.nextQueue<6 do - local len=#seq0 - for i=1,4 do - local count=0 - repeat - i=seq0[P:RND(len)] - count=count+1 - until i~=P.nextQueue[#P.nextQueue].id or count>=len - P:getNext(i) + if #seq0==1 then + local i=seq0[1] + while true do P:getNext(i) yield() end + else + local len=#seq0 + local last=0 + while true do + while #P.nextQueue<6 do + local r=P:RND(len-1) + if r>=last then r=r+1 end + P:getNext(seq0[r]) + last=r end + yield() end - yield() end end, mess=function(P,seq0)