From 8c603fadeed0c3d1d9b730d94d42eeb271c064fb Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Wed, 26 Oct 2022 11:47:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=8D=E8=81=94=E7=BD=91?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E4=BD=BF=E7=94=A8=E9=9D=9E=E6=B3=95=E5=9D=97?= =?UTF-8?q?=E7=9A=AE=E8=82=A4=20=E6=A3=80=E6=B5=8B=E5=88=B0=E8=81=94?= =?UTF-8?q?=E7=BD=91=E7=8E=A9=E5=AE=B6=E6=94=BB=E5=87=BB=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E6=AD=A5=E5=90=8E=E4=BC=9A=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E6=94=BE=E5=BC=83=E6=B8=B8=E6=88=8F=20close?= =?UTF-8?q?=20#720?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/init.lua | 1 + parts/player/player.lua | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/parts/player/init.lua b/parts/player/init.lua index f5cd63ce..d109f719 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -410,6 +410,7 @@ function PLY.newRemotePlayer(id,mini,p) P.uid=p.uid P.sid=NET.uid_sid[p.uid] P.group=p.group + P.netAtk=0 if not (P.group%1==0 and P.group>=1 and P.group<=6) then P.group=0 end _loadRemoteEnv(P,p.config) diff --git a/parts/player/player.lua b/parts/player/player.lua index 07e4d40a..6c1eb752 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -2605,6 +2605,13 @@ local function update_streaming(P) local line=int(event/0x100000000)%0x10000 for _,p in next,PLY_ALIVE do if p.sid==sid then + P.netAtk=P.netAtk+amount + if P.netAtk~=P.stat.atk then + MES.new('warn',"#"..P.uid..' desynchronized') + NET.player_finish({foo=""}) + P:lose(true) + return + end P:attack(p,amount,time,line,true) P:createBeam(p,amount) break