移除一段goto

This commit is contained in:
MrZ626
2021-03-22 21:19:48 +08:00
parent 55bba313fe
commit 13f1ae7c6f

View File

@@ -378,55 +378,55 @@ function update.remote_alive(P,dt)
frmStep<240 and 2 or frmStep<240 and 2 or
frmStep<480 and rnd(2,3) or frmStep<480 and rnd(2,3) or
3 3
::readNext:: repeat
local pos=P.streamProgress local pos=P.streamProgress
local eventTime=P.stream[pos] local eventTime=P.stream[pos]
if eventTime then if eventTime then
if P.stat.frame==eventTime then if P.stat.frame==eventTime then
local event=P.stream[pos+1] local event=P.stream[pos+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
P:pressKey(event) P:pressKey(event)
elseif event<=64 then--Release key elseif event<=64 then--Release key
P:releaseKey(event-32) P:releaseKey(event-32)
elseif event>0x2000000000000 then--Sending lines elseif event>0x2000000000000 then--Sending lines
local sid=tostring(event%0x100) local sid=tostring(event%0x100)
local amount=int(event/0x100)%0x100 local amount=int(event/0x100)%0x100
local time=int(event/0x10000)%0x10000 local time=int(event/0x10000)%0x10000
local line=int(event/0x100000000)%0x10000 local line=int(event/0x100000000)%0x10000
local L=PLAYERS.alive local L=PLAYERS.alive
for i=1,#L do for i=1,#L do
if L[i].subID==sid then if L[i].subID==sid then
P:attack(L[i],amount,time,line,true) P:attack(L[i],amount,time,line,true)
if SETTING.atkFX>0 then if SETTING.atkFX>0 then
P:createBeam(L[i],amount,P.cur.color) 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 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
end end
P.streamProgress=pos+2
else
update.alive(P,dt)
frmStep=frmStep-1
end end
P.streamProgress=pos+2 else
goto readNext frmStep=frmStep-1
end end
update.alive(P,dt) until frmStep<=0
end
if frmStep>1 then
frmStep=frmStep-1
goto readNext
end
end end
return update return update