diff --git a/parts/ai.lua b/parts/ai.lua index 834baf9b..0e302398 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -279,10 +279,11 @@ return{ end, }, ["CC"]=CC and{ - [0]=NULL, + [0]=function(P) + LOG.print("CC is dead ("..P.id..")","error") + end, function(P)--Start thinking if not pcall(CC.think,P.AI_bot)then - LOG.print("CC is dead ("..P.id..")","error") return 0 end return 2 @@ -316,7 +317,6 @@ return{ return 2 end else - LOG.print("CC is dead ("..P.id..")","error") return 0 end end, diff --git a/parts/player/update.lua b/parts/player/update.lua index 15025efe..b2cbb712 100644 --- a/parts/player/update.lua +++ b/parts/player/update.lua @@ -145,7 +145,9 @@ function update.alive(P,dt) local C=P.AI_keys P.AI_delay=P.AI_delay-1 if not C[1]then - P.AI_stage=AIFUNC[P.AI_mode][P.AI_stage](P,C) + if P.AI_stage then + P.AI_stage=AIFUNC[P.AI_mode][P.AI_stage](P,C) + end elseif P.AI_delay<=0 then P:pressKey(C[1])P:releaseKey(C[1]) if P.AI_mode~="CC"or C[1]>3 then