修正玩家计时器不正确

This commit is contained in:
MrZ626
2021-09-29 15:12:21 +08:00
parent 6261256dea
commit 90d51b979a

View File

@@ -2212,14 +2212,12 @@ function Player:update(dt)
self.trigFrame=self.trigFrame+(self.gameEnv.FTLock and dt*60 or 1) self.trigFrame=self.trigFrame+(self.gameEnv.FTLock and dt*60 or 1)
if self.alive then if self.alive then
local S=self.stat local S=self.stat
if self.timing then S.time=S.time+dt end
if self.type=='computer'then if self.type=='computer'then
self.bot:update(dt) self.bot:update(dt)
end end
while self.trigFrame>=1 do while self.trigFrame>=1 do
if self.alive then if self.alive then
if self.streamProgress then if self.streamProgress then
S.time=self.frameRun/60
local frameDelta=self.type=='remote'and (self.stream[#self.stream-1]or 0)-self.frameRun or 0 local frameDelta=self.type=='remote'and (self.stream[#self.stream-1]or 0)-self.frameRun or 0
for _=1, for _=1,
frameDelta<26 and 1 or frameDelta<26 and 1 or
@@ -2233,7 +2231,9 @@ function Player:update(dt)
update_streaming(self) update_streaming(self)
update_alive(self) update_alive(self)
end end
S.time=self.stat.frame/60
else else
if self.timing then S.time=S.time+dt end
update_alive(self) update_alive(self)
end end
else else