fix noInitSZO
This commit is contained in:
@@ -330,15 +330,24 @@ local function _applyGameEnv(P)-- Finish gameEnv processing
|
|||||||
|
|
||||||
local seqGen=coroutine.create(getSeqGen(P))
|
local seqGen=coroutine.create(getSeqGen(P))
|
||||||
local seqCalled=false
|
local seqCalled=false
|
||||||
|
local initSZOcount=0
|
||||||
function P:newNext()
|
function P:newNext()
|
||||||
local status,piece
|
local status,piece
|
||||||
if seqCalled then
|
if seqCalled then
|
||||||
status,piece=coroutine.resume(seqGen,P.field,P.stat)
|
status,piece=coroutine.resume(seqGen,P.field,P.stat)
|
||||||
else
|
else
|
||||||
status,piece=coroutine.resume(seqGen,P.seqRND,P.gameEnv.seqData)
|
status,piece=coroutine.resume(seqGen,P.seqRND,P.gameEnv.seqData)
|
||||||
|
seqCalled=true
|
||||||
end
|
end
|
||||||
seqCalled=true
|
|
||||||
if status and piece then
|
if status and piece then
|
||||||
|
if ENV.noInitSZO and initSZOcount<5 then
|
||||||
|
initSZOcount=initSZOcount+1
|
||||||
|
if piece==1 or piece==2 or piece==6 then
|
||||||
|
return self:newNext()
|
||||||
|
else
|
||||||
|
initSZOcount=5
|
||||||
|
end
|
||||||
|
end
|
||||||
P:getNext(piece)
|
P:getNext(piece)
|
||||||
elseif not status then
|
elseif not status then
|
||||||
assert(piece=='cannot resume dead coroutine')
|
assert(piece=='cannot resume dead coroutine')
|
||||||
@@ -347,18 +356,6 @@ local function _applyGameEnv(P)-- Finish gameEnv processing
|
|||||||
for _=1,ENV.nextCount do
|
for _=1,ENV.nextCount do
|
||||||
P:newNext()
|
P:newNext()
|
||||||
end
|
end
|
||||||
-- TODO: make noInitSZO work
|
|
||||||
-- if ENV.noInitSZO then
|
|
||||||
-- for _=1,5 do
|
|
||||||
-- local C=P.nextQueue[1]
|
|
||||||
-- if C and (C.id==1 or C.id==2 or C.id==6) then
|
|
||||||
-- table.remove(P.nextQueue,1)
|
|
||||||
-- else
|
|
||||||
-- break
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- P:newNext()
|
|
||||||
-- end
|
|
||||||
|
|
||||||
if P.miniMode then
|
if P.miniMode then
|
||||||
ENV.lockFX=false
|
ENV.lockFX=false
|
||||||
|
|||||||
Reference in New Issue
Block a user