From 3b5d21fcd4023dff2a0c41cf2b7852dcdd7f3b6f Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 6 Apr 2021 00:43:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/ai.lua | 2 +- parts/gametoolfunc.lua | 4 +--- parts/player/player.lua | 2 +- parts/scenes/dict.lua | 2 +- parts/scenes/net_game.lua | 4 ---- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/parts/ai.lua b/parts/ai.lua index 0d4122df..6f2c0d93 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -73,7 +73,7 @@ if type(_CC)=="table"then end CC.updateField(P) - while P.holdQueue[1]do rem(P.holdQueue)end + TABLE.clear(P.holdQueue) P.holdTime=P.gameEnv.holdCount P.cur=rem(P.nextQueue,1) diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 38e16886..161b5f45 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -537,9 +537,7 @@ function destroyPlayers()--Destroy all player objects, restore freerows and free end PLAYERS[i]=nil end - for i=#PLY_ALIVE,1,-1 do - PLY_ALIVE[i]=nil - end + TABLE.clear(PLY_ALIVE) collectgarbage() end function restoreVirtualkey() diff --git a/parts/player/player.lua b/parts/player/player.lua index 2844b383..195add8a 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1725,7 +1725,7 @@ function Player:lose(force) if self.AI_mode=="CC"then CC.destroy(self.AI_bot) - while self.holdQueue[1]do rem(self.holdQueue)end + TABLE.clear(self.holdQueue) self:loadAI(self.AIdata) end diff --git a/parts/scenes/dict.lua b/parts/scenes/dict.lua index 9ae92356..5f394ad6 100644 --- a/parts/scenes/dict.lua +++ b/parts/scenes/dict.lua @@ -36,7 +36,7 @@ function scene.sceneInit() end local function clearResult() - for _=1,#result do rem(result)end + TABLE.clear(result) selected,scrollPos=1,0 waiting,lastSearch=0,false end diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 65fb034e..5bd9c6e3 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -14,7 +14,6 @@ local PLY_NET=PLY_NET local hideChatBox local textBox=WIDGET.newTextBox{name="texts",x=340,y=80,w=600,h=550,hide=function()return hideChatBox end} -local playerInitialized local playing local lastUpstreamTime local upstreamProgress @@ -31,16 +30,13 @@ end function scene.sceneInit() love.keyboard.setKeyRepeat(false) hideChatBox=true - playerInitialized=false textBox:clear() - while #PLY_NET>0 do rem(PLY_NET)end resetGameData("n") noTouch=not SETTING.VKSwitch playing=false lastUpstreamTime=0 upstreamProgress=1 - heartBeatTimer=0 end function scene.touchDown(x,y)