From 13f1ae7c6f058800b01321dec87fe489c00876c5 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 22 Mar 2021 21:19:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=80=E6=AE=B5goto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/update.lua | 90 ++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/parts/player/update.lua b/parts/player/update.lua index f016a040..0834de0f 100644 --- a/parts/player/update.lua +++ b/parts/player/update.lua @@ -378,55 +378,55 @@ function update.remote_alive(P,dt) frmStep<240 and 2 or frmStep<480 and rnd(2,3) or 3 - ::readNext:: - local pos=P.streamProgress - local eventTime=P.stream[pos] - if eventTime then - if P.stat.frame==eventTime then - local event=P.stream[pos+1] - if event==0 then--Just wait - elseif event<=32 then--Press key - P:pressKey(event) - elseif event<=64 then--Release key - P:releaseKey(event-32) - elseif event>0x2000000000000 then--Sending lines - local sid=tostring(event%0x100) - local amount=int(event/0x100)%0x100 - local time=int(event/0x10000)%0x10000 - local line=int(event/0x100000000)%0x10000 - local L=PLAYERS.alive - for i=1,#L do - if L[i].subID==sid then - P:attack(L[i],amount,time,line,true) - if SETTING.atkFX>0 then - P:createBeam(L[i],amount,P.cur.color) + repeat + local pos=P.streamProgress + local eventTime=P.stream[pos] + if eventTime then + if P.stat.frame==eventTime then + local event=P.stream[pos+1] + if event==0 then--Just wait + elseif event<=32 then--Press key + P:pressKey(event) + elseif event<=64 then--Release key + P:releaseKey(event-32) + elseif event>0x2000000000000 then--Sending lines + local sid=tostring(event%0x100) + local amount=int(event/0x100)%0x100 + local time=int(event/0x10000)%0x10000 + local line=int(event/0x100000000)%0x10000 + local L=PLAYERS.alive + for i=1,#L do + if L[i].subID==sid then + P:attack(L[i],amount,time,line,true) + if SETTING.atkFX>0 then + P:createBeam(L[i],amount,P.cur.color) + end + break + end + end + elseif event>0x1000000000000 then--Receiving lines + local L=PLAYERS.alive + local sid=tostring(event%0x100) + for i=1,#L do + if L[i].subID==sid then + P:receive( + L[i], + int(event/0x100)%0x100,--amount + int(event/0x10000)%0x10000,--time + int(event/0x100000000)%0x10000--line + ) + break end - break - end - end - elseif event>0x1000000000000 then--Receiving lines - local L=PLAYERS.alive - local sid=tostring(event%0x100) - for i=1,#L do - if L[i].subID==sid then - P:receive( - L[i], - int(event/0x100)%0x100,--amount - int(event/0x10000)%0x10000,--time - int(event/0x100000000)%0x10000--line - ) - break end end + P.streamProgress=pos+2 + else + update.alive(P,dt) + frmStep=frmStep-1 end - P.streamProgress=pos+2 - goto readNext + else + frmStep=frmStep-1 end - update.alive(P,dt) - end - if frmStep>1 then - frmStep=frmStep-1 - goto readNext - end + until frmStep<=0 end return update \ No newline at end of file