From f9650c565c99a340f237a8827f849e1d8efd35f0 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 24 Sep 2021 02:28:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0=E7=8E=A9=E5=AE=B6stat?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=92=8C=E5=B8=A7=E6=95=B0=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=A7=BB=E5=88=B0update=E5=87=BD=E6=95=B0=E5=A4=96?= =?UTF-8?q?=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/player.lua | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/parts/player/player.lua b/parts/player/player.lua index fd2889d0..08070c22 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1844,11 +1844,6 @@ local function update_alive(P) return true end - if P.timing then - S.time=S.time+1/60 - S.frame=S.frame+1 - end - --Calculate key speed do local v=0 @@ -2160,16 +2155,24 @@ function Player:update(dt) update_remote_alive(self,dt) else self.trigFrame=self.trigFrame+(self.gameEnv.FTLock and dt*60 or 1) - while self.trigFrame>=1 do - if self.alive then - update_alive(self) - if self.type=='computer'then - self.bot:update(dt) - end - else - update_dead(self) + if self.alive then + if self.timing then + local S=self.stat + S.frame=S.frame+1 + S.time=S.time+dt + end + while self.trigFrame>=1 do + update_alive(self) + self.trigFrame=self.trigFrame-1 + end + if self.type=='computer'then + self.bot:update(dt) + end + else + while self.trigFrame>=1 do + update_dead(self) + self.trigFrame=self.trigFrame-1 end - self.trigFrame=self.trigFrame-1 end end _updateFX(self,dt)