From 38688cc83a5bdd700225f00c93b9361aa150ce64 Mon Sep 17 00:00:00 2001 From: ZONT_ Date: Thu, 30 Apr 2026 01:41:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=81=D1=86=D0=B5?= =?UTF-8?q?=D0=BF=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=20=D1=81=D0=BF=D0=B0?= =?UTF-8?q?=D0=B2=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_train_couple/init.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lua/entities/gmod_train_couple/init.lua b/lua/entities/gmod_train_couple/init.lua index 84f8316..bda2a4c 100644 --- a/lua/entities/gmod_train_couple/init.lua +++ b/lua/entities/gmod_train_couple/init.lua @@ -313,7 +313,18 @@ function ENT:OnDecouple() end end +local vector_zero = Vector(0, 0, 0) function ENT:Think() - self:NextThink(CurTime()+1) + local train = self:GetNW2Entity("TrainEntity") + if IsValid(train) and train.OnCoupled and not IsValid(self.Coupled) then + -- Fixing crazy physics on spawn + local phy = self:GetPhysicsObject() + if IsValid(phy) then + phy:SetAngleVelocityInstantaneous(vector_zero) + end + self:NextThink(CurTime()) + else + self:NextThink(CurTime() + 1) + end return true end