From f7e4e474665d38eaf68ce30958214dc768b9d11f Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sat, 10 Aug 2024 15:09:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E4=BF=AE=E6=96=B0=E7=9A=84=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=B3=BB=E7=BB=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/player.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/parts/player/player.lua b/parts/player/player.lua index bf26deea..07fc3eac 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -2713,7 +2713,7 @@ local function update_alive(P,dt) end local function update_streaming(P) local eventTime=P.stream[P.streamProgress] - while eventTime and P.frameRun==eventTime do + while eventTime and P.frameRun==eventTime or eventTime==0 do local event=P.stream[P.streamProgress+1] if event==0 then-- Just wait elseif event<=32 then-- Press key @@ -2733,18 +2733,20 @@ local function update_streaming(P) local SRC local SELF for _,p in next,PLAYERS do - if p.sid==sourceSid then + if P==sourceSid and p.sid==sourceSid then SRC=p break end end - for _,p in next,PLAYERS do - if p.type=='human' then - SELF=p - break + if SRC then + for _,p in next,PLAYERS do + if p.type=='human' then + SELF=p + break + end end + SELF.gameEnv.extraEventHandler[eventName](SRC,SELF,unpack(paramList)) end - SELF.gameEnv.extraEventHandler[eventName](SRC,SELF,unpack(paramList)) end P.streamProgress=P.streamProgress+2 eventTime=P.stream[P.streamProgress]