mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-02 00:42:29 +00:00
Фикс сцепки при спавне
This commit is contained in:
@@ -313,7 +313,18 @@ function ENT:OnDecouple()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local vector_zero = Vector(0, 0, 0)
|
||||||
function ENT:Think()
|
function ENT:Think()
|
||||||
|
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)
|
self:NextThink(CurTime() + 1)
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user