make sequence generator independent of player

This commit is contained in:
Imple Lee
2023-07-12 07:27:22 +08:00
parent c25e7a3d5b
commit 8304cf655b
2 changed files with 2 additions and 4 deletions

View File

@@ -328,7 +328,7 @@ local function _applyGameEnv(P)-- Finish gameEnv processing
ENV.nextPos=false
end
local seqGen=coroutine.create(getSeqGen(P))
local seqGen=coroutine.create(getSeqGen(ENV.sequence))
local seqCalled=false
local initSZOcount=0
function P:newNext()

View File

@@ -223,8 +223,7 @@ local seqGenerators={
end
end,
}
return function(P)-- Return a piece-generating function for player P
local s=P.gameEnv.sequence
return function(s)-- Return a piece-generating function for player P
if type(s)=='function' then
return s
elseif type(s)=='string' and seqGenerators[s] then
@@ -235,7 +234,6 @@ return function(P)-- Return a piece-generating function for player P
"No sequence mode called "..s or
"Wrong sequence generator"
)
P.gameEnv.sequence='bag'
return seqGenerators.bag
end
end