replace goto with repeat...until in cold-clear
This commit is contained in:
11
parts/ai.lua
11
parts/ai.lua
@@ -281,9 +281,11 @@ return{
|
|||||||
if not pcall(CC.think,P.AI_bot)then break end
|
if not pcall(CC.think,P.AI_bot)then break end
|
||||||
|
|
||||||
--Poll keys
|
--Poll keys
|
||||||
::AGAIN::
|
local success,result,dest,hold,move
|
||||||
YIELD()
|
repeat
|
||||||
local success,result,dest,hold,move=pcall(CC.getMove,P.AI_bot)
|
YIELD()
|
||||||
|
success,result,dest,hold,move=pcall(CC.getMove,P.AI_bot)
|
||||||
|
until not success or result == 0 or result == 2
|
||||||
if not success then break end
|
if not success then break end
|
||||||
if result==2 then
|
if result==2 then
|
||||||
ins(keys,6)
|
ins(keys,6)
|
||||||
@@ -304,9 +306,6 @@ return{
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
ins(keys,6)
|
ins(keys,6)
|
||||||
else
|
|
||||||
--Stay this stage until get keys
|
|
||||||
goto AGAIN
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--Check if time to change target
|
--Check if time to change target
|
||||||
|
|||||||
Reference in New Issue
Block a user