From f7d435748c0cf93b1094c1fae571d52ee5ae437e Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 17 Sep 2020 22:10:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9CC=E5=B4=A9=E6=BA=83=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=B8=80=E5=AE=9A=E4=BF=9D=E6=8A=A4=EF=BC=8C=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=B8=8D=E4=BC=9A=E9=97=AA=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/ai.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/parts/ai.lua b/parts/ai.lua index 06e798b7..4be089bf 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -91,12 +91,17 @@ do while i<400 do F[i],i=false,i+1 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 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.AI_keys={} - CC.destroy(P.AI_bot) local opt,wei=CC.getConf() CC.setHold(opt,P.AIdata.hold) CC.set20G(opt,P.AIdata._20G) @@ -321,8 +326,12 @@ return{ end, }, ["CC"]={ + [0]=NULL, 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 end, function(P,ctrl)--Poll keys