diff --git a/parts/player/update.lua b/parts/player/update.lua index 3b8620d7..76c66b73 100644 --- a/parts/player/update.lua +++ b/parts/player/update.lua @@ -397,14 +397,16 @@ function update.dead(P,dt) updateTasks(P) end function update.remote_alive(P,dt) - local frmDelta=PLAYERS[1].frameRun-P.frameRun - for _=1, - frmDelta<20 and 1 or - frmDelta<45 and rnd(2)or - frmDelta<90 and 2 or - frmDelta<180 and rnd(2,3)or - 3 - do + local frameRate=(P.stream[#P.stream-1]or 0)-P.frameRun + frameRate=frameRate<20 and 1 or + frameRate<30 and rnd(2)or + frameRate<60 and 2 or + frameRate<90 and 3 or + frameRate<120 and 5 or + frameRate<150 and 7 or + frameRate<180 and 10 or + 20 + for _=1,frameRate do local eventTime=P.stream[P.streamProgress] if eventTime then--Normal state, event forward if P.frameRun==eventTime then--Event time, execute action, read next so don't update immediately @@ -444,7 +446,7 @@ function update.remote_alive(P,dt) end P.streamProgress=P.streamProgress+2 else--No event now, run one frame - update.alive(P,dt) + update.alive(P,dt/frameRate) end else--Pause state, no actions, quit loop break