From 4e47b0acb7e4ddc2060991ffd49e8ea68d90b2d7 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 23 Aug 2021 04:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E6=95=B4=E7=90=86cc=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/ai.lua | 5 +---- parts/player/player.lua | 7 +++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/parts/ai.lua b/parts/ai.lua index 970e5612..1764496e 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -72,10 +72,7 @@ if type(_CC)=='table'then end end function CC.switch20G(P) - if not pcall(CC.destroy,P.AI_bot)then - P:destroyBot() - return - end + P:destroyBot() P.AIdata._20G=true P.AI_keys={} local opt,wei=CC.getConf() diff --git a/parts/player/player.lua b/parts/player/player.lua index 385e0247..2c04db10 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -242,7 +242,10 @@ function Player:setRS(RSname) end function Player:destroyBot() if self.AI_mode=='CC'then - if self.AI_bot then CC.destroy(self.AI_bot)end + if self.AI_bot then + CC.destroy(self.AI_bot) + self.AI_bot=nil + end end self.AI_thread=nil end @@ -1688,7 +1691,7 @@ function Player:revive() end self.garbageBeneath=0 if self.AI_mode=='CC'then - CC.destroy(self.AI_bot) + self:destroyBot() TABLE.cut(self.holdQueue) self:loadAI(self.AIdata) end