diff --git a/parts/modes/custom_clear.lua b/parts/modes/custom_clear.lua index 951a1606..74b9814b 100644 --- a/parts/modes/custom_clear.lua +++ b/parts/modes/custom_clear.lua @@ -14,10 +14,11 @@ return { PLY.newPlayer(1) local AItype=GAME.modeEnv.opponent:sub(1,2) local AIlevel=tonumber(GAME.modeEnv.opponent:sub(-1)) + local useHold=GAME.modeEnv.holdCount>0 and GAME.modeEnv.holdMode=='hold' if AItype=='9S' then - PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=GAME.modeEnv.holdCount}) + PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=useHold}) elseif AItype=='CC' then - PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=GAME.modeEnv.holdCount,node=20000+5000*AIlevel}) + PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=useHold,node=20000+5000*AIlevel}) end for _,P in next,PLY_ALIVE do diff --git a/parts/modes/custom_puzzle.lua b/parts/modes/custom_puzzle.lua index 6da31d4c..ddda4752 100644 --- a/parts/modes/custom_puzzle.lua +++ b/parts/modes/custom_puzzle.lua @@ -56,10 +56,11 @@ return { local AItype=GAME.modeEnv.opponent:sub(1,2) local AIlevel=tonumber(GAME.modeEnv.opponent:sub(-1)) PLY.newPlayer(1) + local useHold=GAME.modeEnv.holdCount>0 and GAME.modeEnv.holdMode=='hold' if AItype=='9S' then - PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=GAME.modeEnv.holdCount}) + PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=useHold}) elseif AItype=='CC' then - PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=GAME.modeEnv.holdCount,node=20000+5000*AIlevel}) + PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=useHold,node=20000+5000*AIlevel}) end end, savePrivate=function()