再修新的事件系统问题

This commit is contained in:
MrZ_26
2024-08-10 15:09:27 +08:00
parent 8779abef9a
commit f7e4e47466

View File

@@ -2713,7 +2713,7 @@ local function update_alive(P,dt)
end end
local function update_streaming(P) local function update_streaming(P)
local eventTime=P.stream[P.streamProgress] 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] local event=P.stream[P.streamProgress+1]
if event==0 then-- Just wait if event==0 then-- Just wait
elseif event<=32 then-- Press key elseif event<=32 then-- Press key
@@ -2733,18 +2733,20 @@ local function update_streaming(P)
local SRC local SRC
local SELF local SELF
for _,p in next,PLAYERS do for _,p in next,PLAYERS do
if p.sid==sourceSid then if P==sourceSid and p.sid==sourceSid then
SRC=p SRC=p
break break
end end
end end
for _,p in next,PLAYERS do if SRC then
if p.type=='human' then for _,p in next,PLAYERS do
SELF=p if p.type=='human' then
break SELF=p
break
end
end end
SELF.gameEnv.extraEventHandler[eventName](SRC,SELF,unpack(paramList))
end end
SELF.gameEnv.extraEventHandler[eventName](SRC,SELF,unpack(paramList))
end end
P.streamProgress=P.streamProgress+2 P.streamProgress=P.streamProgress+2
eventTime=P.stream[P.streamProgress] eventTime=P.stream[P.streamProgress]