diff --git a/Content.Client/Physics/Controllers/MoverController.cs b/Content.Client/Physics/Controllers/MoverController.cs index 77148fec6d..b698543f0c 100644 --- a/Content.Client/Physics/Controllers/MoverController.cs +++ b/Content.Client/Physics/Controllers/MoverController.cs @@ -6,6 +6,7 @@ using Content.Shared.Pulling.Components; using Robust.Client.Player; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Physics; namespace Content.Client.Physics.Controllers { @@ -29,10 +30,14 @@ namespace Content.Client.Physics.Controllers // We set joints to predicted given these can affect how our mob moves. // I would only recommend disabling this if you make pulling not use joints anymore (someday maybe?) - foreach (var joint in body.Joints) + + if (player.TryGetComponent(out JointComponent? jointComponent)) { - joint.BodyA.Predict = true; - joint.BodyB.Predict = true; + foreach (var joint in jointComponent.GetJoints) + { + joint.BodyA.Predict = true; + joint.BodyB.Predict = true; + } } // If we're being pulled then we won't predict anything and will receive server lerps so it looks way smoother. diff --git a/Content.Shared/Pulling/Components/SharedPullableComponent.cs b/Content.Shared/Pulling/Components/SharedPullableComponent.cs index b8d54dc7e0..0030ba1638 100644 --- a/Content.Shared/Pulling/Components/SharedPullableComponent.cs +++ b/Content.Shared/Pulling/Components/SharedPullableComponent.cs @@ -161,11 +161,13 @@ namespace Content.Shared.Pulling.Components var length = Math.Max(union.Size.X, union.Size.Y) * 0.75f; _physics.WakeBody(); - _pullJoint = pullerPhysics.CreateDistanceJoint(_physics, $"pull-joint-{_physics.Owner.Uid}"); + _pullJoint = EntitySystem.Get().CreateDistanceJoint(Owner.Uid, _puller.Uid, id:$"pull-joint-{_physics.Owner.Uid}"); // _physics.BodyType = BodyType.Kinematic; // TODO: Need to consider their original bodytype _pullJoint.CollideConnected = false; _pullJoint.Length = length * 0.75f; + _pullJoint.MinLength = 0f; _pullJoint.MaxLength = length; + _pullJoint.Stiffness = 1f; } // Code here will not run if pulling a new object was attempted and failed because of the returns from the refactor. } @@ -269,7 +271,7 @@ namespace Content.Shared.Pulling.Components if (_physics != null && _pullJoint != null) { - _physics.RemoveJoint(_pullJoint); + EntitySystem.Get().RemoveJoint(_pullJoint); } if (user != null && user.TryGetComponent(out var puller))