From 50cbc1b31ec9079f09664c714842ffc12e0aab2b Mon Sep 17 00:00:00 2001 From: Anton Shukin Date: Sun, 11 Feb 2024 18:13:19 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BD=D0=B5=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=BF=D0=BE=D0=B4=D0=BA?= =?UTF-8?q?=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=83=D0=B4=D0=BE?= =?UTF-8?q?=D1=87=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_train_bogey/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/entities/gmod_train_bogey/init.lua b/lua/entities/gmod_train_bogey/init.lua index 37ce450..eb09bef 100644 --- a/lua/entities/gmod_train_bogey/init.lua +++ b/lua/entities/gmod_train_bogey/init.lua @@ -403,6 +403,9 @@ function ENT:CheckContact(pos,dir,id,cpos) end end)]] end + if (traceEnt.CoupledWith == nil) then + self.Connectors[id] = nil + end end return false elseif traceEnt:GetClass() == "player" and self.Voltage > 40 then From ff80af115add8b2b1dea2bd50689fa864dd441c1 Mon Sep 17 00:00:00 2001 From: Anton Shukin Date: Sun, 11 Feb 2024 20:30:15 +0300 Subject: [PATCH 2/3] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_train_bogey/init.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lua/entities/gmod_train_bogey/init.lua b/lua/entities/gmod_train_bogey/init.lua index eb09bef..ac6ab1a 100644 --- a/lua/entities/gmod_train_bogey/init.lua +++ b/lua/entities/gmod_train_bogey/init.lua @@ -395,19 +395,14 @@ function ENT:CheckContact(pos,dir,id,cpos) sound.Play("udochka_connect.wav",traceEnt:GetPos()) self.Connectors[id] = traceEnt DropEntityIfHeld(traceEnt) - --[[timer.Simple(0,function() - if not IsValid(traceEnt) or not traceEnt:IsPlayerHolding() then return end - traceEnt:ForcePlayerDrop() - if traceEnt.LastPickup and traceEnt.LastPickup:IsPlayer() then - traceEnt.LastPickup:DropObject() - end - end)]] - end - if (traceEnt.CoupledWith == nil) then - self.Connectors[id] = nil end end return false + elseif self.Connectors[id] == traceEnt then + if traceEnt.Coupled == nil then + self.Connectors[id] = nil + end + return false elseif traceEnt:GetClass() == "player" and self.Voltage > 40 then local pPos = traceEnt:GetPos() self.VoltageDropByTouch = (self.VoltageDropByTouch or 0) + 1 From a7976c9fc9ee2aad86ffa75b5192b84870e8201b Mon Sep 17 00:00:00 2001 From: kosmik641 Date: Fri, 15 Nov 2024 17:00:20 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=83=D0=B4=D0=BE=D1=87=D0=BA=D0=B8=20=D0=B8=D0=B7=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D0=B5=D0=B6=D0=BA=D0=B8=20=D1=81=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D1=83=20=D0=BF=D0=BE=20=D0=B5=D1=91=20=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_track_udochka/init.lua | 4 +++- lua/entities/gmod_train_bogey/init.lua | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lua/entities/gmod_track_udochka/init.lua b/lua/entities/gmod_track_udochka/init.lua index 3186b87..c6f9e1c 100644 --- a/lua/entities/gmod_track_udochka/init.lua +++ b/lua/entities/gmod_track_udochka/init.lua @@ -22,13 +22,15 @@ local function removeWeldBetweenEnts(ent1,ent2) end end function ENT:Use(ply) - if self.Coupled then + if IsValid(self.Coupled) then sound.Play("buttons/lever8.wav",self:GetPos()) removeWeldBetweenEnts(self,self.Coupled) removeWeldBetweenEnts(self.Coupled,self) + self.Coupled.Connectors[self.ConnectorID] = nil self.Timer = CurTime()+2 end + self.ConnectorID = nil self.Coupled = nil if ( self:IsPlayerHolding() ) then return end if ply.PickupObject then ply:PickupObject( self ) end diff --git a/lua/entities/gmod_train_bogey/init.lua b/lua/entities/gmod_train_bogey/init.lua index ac6ab1a..de2cc44 100644 --- a/lua/entities/gmod_train_bogey/init.lua +++ b/lua/entities/gmod_train_bogey/init.lua @@ -392,17 +392,13 @@ function ENT:CheckContact(pos,dir,id,cpos) traceEnt:SetPos(self:LocalToWorld(cpos)) traceEnt:SetAngles(self:GetAngles()) traceEnt.Coupled = self + traceEnt.ConnectorID = id sound.Play("udochka_connect.wav",traceEnt:GetPos()) self.Connectors[id] = traceEnt DropEntityIfHeld(traceEnt) end end return false - elseif self.Connectors[id] == traceEnt then - if traceEnt.Coupled == nil then - self.Connectors[id] = nil - end - return false elseif traceEnt:GetClass() == "player" and self.Voltage > 40 then local pPos = traceEnt:GetPos() self.VoltageDropByTouch = (self.VoltageDropByTouch or 0) + 1