对CC崩溃进行一定保护,游戏可能不会闪退
This commit is contained in:
15
parts/ai.lua
15
parts/ai.lua
@@ -91,12 +91,17 @@ do
|
|||||||
while i<400 do
|
while i<400 do
|
||||||
F[i],i=false,i+1
|
F[i],i=false,i+1
|
||||||
end
|
end
|
||||||
CC.update(P.AI_bot,F,P.b2b>=100,P.combo)
|
if not pcall(CC.update,P.AI_bot,F,P.b2b>=100,P.combo)then
|
||||||
|
LOG.print("CC is dead ("..P.id..")","error")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function CC_switch20G(P)
|
function CC_switch20G(P)
|
||||||
|
if not pcall(CC.destroy,P.AI_bot)then
|
||||||
|
LOG.print("CC is dead ("..P.id..")","error")
|
||||||
|
return
|
||||||
|
end
|
||||||
P.AIdata._20G=true
|
P.AIdata._20G=true
|
||||||
P.AI_keys={}
|
P.AI_keys={}
|
||||||
CC.destroy(P.AI_bot)
|
|
||||||
local opt,wei=CC.getConf()
|
local opt,wei=CC.getConf()
|
||||||
CC.setHold(opt,P.AIdata.hold)
|
CC.setHold(opt,P.AIdata.hold)
|
||||||
CC.set20G(opt,P.AIdata._20G)
|
CC.set20G(opt,P.AIdata._20G)
|
||||||
@@ -321,8 +326,12 @@ return{
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
["CC"]={
|
["CC"]={
|
||||||
|
[0]=NULL,
|
||||||
function(P)--Start thinking
|
function(P)--Start thinking
|
||||||
CC.think(P.AI_bot)
|
if not pcall(CC.think,P.AI_bot)then
|
||||||
|
LOG.print("CC is dead ("..P.id..")","error")
|
||||||
|
return 0
|
||||||
|
end
|
||||||
return 2
|
return 2
|
||||||
end,
|
end,
|
||||||
function(P,ctrl)--Poll keys
|
function(P,ctrl)--Poll keys
|
||||||
|
|||||||
Reference in New Issue
Block a user