修复一个可能是导致CC报错后程序闪退的问题
This commit is contained in:
@@ -279,10 +279,11 @@ return{
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
["CC"]=CC and{
|
["CC"]=CC and{
|
||||||
[0]=NULL,
|
[0]=function(P)
|
||||||
|
LOG.print("CC is dead ("..P.id..")","error")
|
||||||
|
end,
|
||||||
function(P)--Start thinking
|
function(P)--Start thinking
|
||||||
if not pcall(CC.think,P.AI_bot)then
|
if not pcall(CC.think,P.AI_bot)then
|
||||||
LOG.print("CC is dead ("..P.id..")","error")
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
return 2
|
return 2
|
||||||
@@ -316,7 +317,6 @@ return{
|
|||||||
return 2
|
return 2
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
LOG.print("CC is dead ("..P.id..")","error")
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -145,7 +145,9 @@ function update.alive(P,dt)
|
|||||||
local C=P.AI_keys
|
local C=P.AI_keys
|
||||||
P.AI_delay=P.AI_delay-1
|
P.AI_delay=P.AI_delay-1
|
||||||
if not C[1]then
|
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
|
elseif P.AI_delay<=0 then
|
||||||
P:pressKey(C[1])P:releaseKey(C[1])
|
P:pressKey(C[1])P:releaseKey(C[1])
|
||||||
if P.AI_mode~="CC"or C[1]>3 then
|
if P.AI_mode~="CC"or C[1]>3 then
|
||||||
|
|||||||
Reference in New Issue
Block a user