From ca68a8ef872688f37033fd773b8e8c90aa4e9227 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 12 Apr 2021 23:10:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E6=AD=BB=E4=BA=A1=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E4=BB=A5=E6=9C=8D=E5=8A=A1=E5=99=A8=E4=B8=BA=E5=87=86?= =?UTF-8?q?=EF=BC=8C=E5=BD=95=E5=83=8F=E4=B8=8D=E5=90=8C=E6=AD=A5=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E5=BD=B1=E5=93=8D=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/net.lua | 8 +++++++- parts/player/player.lua | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/parts/net.lua b/parts/net.lua index f156e0ab..80871d10 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -493,7 +493,13 @@ function NET.updateWS_stream() elseif res.action==3 then--Player leave --? elseif res.action==4 then--Player died - --? + local uid=res.data.uid + for _,P in next,PLY_ALIVE do + if P.uid==uid then + P:lose(true) + break + end + end elseif res.action==5 then--Receive stream SCN.socketRead("Stream",d) end diff --git a/parts/player/player.lua b/parts/player/player.lua index 6f85364f..8919d652 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1724,6 +1724,7 @@ function Player:win(result) end function Player:lose(force) if self.result then return end + if self.type=="remote"and not force then self.waiting=1e99 return end if self.life>0 and not force then self.waiting=62 local h=#self.field