From 8203f75cc90c47d9a7665b32e527bca885be766e Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 8 Oct 2021 16:48:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9C=E7=A8=8B=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6update=E6=B5=81=E7=A8=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/player.lua | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/parts/player/player.lua b/parts/player/player.lua index a9c6490b..7ead1e58 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -2213,24 +2213,30 @@ function Player:update(dt) self.trigFrame=self.trigFrame+(self.gameEnv.FTLock and dt*60 or 1) if self.alive then local S=self.stat - if self.type=='computer'then - self.bot:update(dt) - end + if self.type=='computer'then self.bot:update(dt)end while self.trigFrame>=1 do if self.alive then if self.streamProgress then - local frameDelta=self.type=='remote'and (self.stream[#self.stream-1]or 0)-self.frameRun or 0 - for _=1, - frameDelta<26 and 1 or - frameDelta<50 and 2 or - frameDelta<80 and 3 or - frameDelta<120 and 5 or - frameDelta<160 and 7 or - frameDelta<200 and 10 or - 20 - do - update_streaming(self) - update_alive(self) + local frameDelta + if self.type=='remote'then + frameDelta=(self.stream[#self.stream-1]or 0)-self.frameRun + if frameDelta==0 then frameDelta=nil end + else + frameDelta=0 + end + if frameDelta then + for _=1, + frameDelta<26 and 1 or + frameDelta<50 and 2 or + frameDelta<80 and 3 or + frameDelta<120 and 5 or + frameDelta<160 and 7 or + frameDelta<200 and 10 or + 20 + do + update_streaming(self) + update_alive(self) + end end S.time=self.stat.frame/60 else