修复序列生成器不小心用了全局随机函数导致录像不能正确播放,更改序列生成模块名

This commit is contained in:
MrZ626
2021-03-16 12:11:57 +08:00
parent 20da98f597
commit 68d8ed9df0
2 changed files with 6 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
local Player=require"parts.player.player" local Player=require"parts.player.player"
local prepareSequence=require"parts.player.prepareSequence" local sequenceGenerator=require"parts.player.sequenceGenerator"
local gameEnv0=require"parts.player.gameEnv0" local gameEnv0=require"parts.player.gameEnv0"
local rnd,max=math.random,math.max local rnd,max=math.random,math.max
@@ -166,7 +166,7 @@ local function newEmptyPlayer(id,mini)
P.type="none" P.type="none"
P.sound=false P.sound=false
-- P.newNext=false--Call prepareSequence()to get a function to get new next -- P.newNext=false--Coroutine to get new next, loaded in applyGameEnv()
P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end P.keyPressing={}for i=1,12 do P.keyPressing[i]=false end
P.movDir,P.moving,P.downing=0,0,0--Last move key,DAS charging,downDAS charging P.movDir,P.moving,P.downing=0,0,0--Last move key,DAS charging,downDAS charging
@@ -299,7 +299,7 @@ local function applyGameEnv(P)--Finish gameEnv processing
end end
if ENV.nextCount==0 then ENV.nextPos=false end if ENV.nextCount==0 then ENV.nextPos=false end
prepareSequence(P) sequenceGenerator(P)
if P.mini then if P.mini then
ENV.lockFX=false ENV.lockFX=false

View File

@@ -1,4 +1,3 @@
local rnd=math.random
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local yield=coroutine.yield local yield=coroutine.yield
@@ -14,7 +13,7 @@ local sequenceModes={
bag[i]=seq0[len-i+1] bag[i]=seq0[len-i+1]
end end
end end
P:getNext(rem(bag,rnd(#bag))) P:getNext(rem(bag,P:RND(#bag)))
end end
yield() yield()
end end
@@ -57,7 +56,7 @@ local sequenceModes={
end end
end, end,
rnd=function(P,seq0) rnd=function(P,seq0)
P:getNext(seq0[rnd(#seq0)]) P:getNext(seq0[P:RND(#seq0)])
while true do while true do
while #P.nextQueue<6 do while #P.nextQueue<6 do
local len=#seq0 local len=#seq0
@@ -91,7 +90,7 @@ local sequenceModes={
bufferSeq[i]=bag[i] bufferSeq[i]=bag[i]
end end
end end
P:getNext(rem(bag,rnd(#bag))) P:getNext(rem(bag,P:RND(#bag)))
end end
yield() yield()
end end