From e977f84ed3fc7b2fb7f0bc9fe83b5260eea17a92 Mon Sep 17 00:00:00 2001 From: kosmik641 Date: Sat, 20 Dec 2025 17:55:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=86=D0=B5=D0=BF=D0=BA=D0=B0.=20=D0=A3?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20=D0=BF=D1=80=D0=B8=D0=B2=D1=8F?= =?UTF-8?q?=D0=B7=D0=BA=D0=B0=20=D0=BD=D0=B0=D0=BB=D0=B8=D1=87=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=AD=D0=9A=D0=9A=20=D0=BA=20=D1=82=D0=B8=D0=BF=D1=83=20?= =?UTF-8?q?=D1=81=D1=86=D0=B5=D0=BF=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_train_couple/init.lua | 32 +++++++++++-------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/lua/entities/gmod_train_couple/init.lua b/lua/entities/gmod_train_couple/init.lua index 414688c..84f8316 100644 --- a/lua/entities/gmod_train_couple/init.lua +++ b/lua/entities/gmod_train_couple/init.lua @@ -154,31 +154,27 @@ function ENT:Use(ply) net.WriteEntity(self) net.WriteBool(not self.CPPICanUse or self:CPPICanUse(ply)) net.WriteBool(self.CoupledEnt ~= nil) + + local isolPresent = false + local isolated = false + local noEKK = false if IsValid(train) then if isfront and train.FrontBrakeLineIsolation and train.FrontTrainLineIsolation then - net.WriteBool(true) - net.WriteBool(train.FrontBrakeLineIsolation.Value>0 and train.FrontTrainLineIsolation.Value>0) + isolPresent = true + isolated = train.FrontBrakeLineIsolation.Value>0 and train.FrontTrainLineIsolation.Value>0 elseif not isfront and train.RearBrakeLineIsolation and train.RearTrainLineIsolation then - net.WriteBool(true) - net.WriteBool(train.RearBrakeLineIsolation.Value>0 and train.RearTrainLineIsolation.Value>0) - else - net.WriteBool(false) - net.WriteBool(false) + isolPresent = true + isolated = train.RearBrakeLineIsolation.Value>0 and train.RearTrainLineIsolation.Value>0 end - else - net.WriteBool(false) - net.WriteBool(false) + + noEKK = isfront and train.SubwayTrain and train.SubwayTrain.NoFrontEKK end - net.WriteBool(self.CoupleType=="722") + + net.WriteBool(isolPresent) + net.WriteBool(isolated) + net.WriteBool(noEKK) net.WriteBool(self.EKKDisconnected) net.Send(ply) - --[[ if self.CoupledEnt ~= nil then - local tr = ply:GetEyeTrace() - if not tr.Hit then return end - if self:LocalToWorld(self.CouplingPointOffset):Distance(tr.HitPos) < 25 then - self:Decouple() - end - end--]] end function ENT:ElectricDisconnected()