From dd178ef3f513738bb916d9484a16a6b6a35e33ff Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 15 Sep 2022 23:19:40 +1000 Subject: [PATCH] Break joints on entering vehicle (#11313) The issue is that both bodies go to sleep on the server-side so it mispredicts like crazy on the client then when you unbuckle it snaps. This is just a bandaid until buckling + vehicles get some more love in future. --- Content.Server/Vehicle/VehicleSystem.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Content.Server/Vehicle/VehicleSystem.cs b/Content.Server/Vehicle/VehicleSystem.cs index fe2cabb951..cffacd21d3 100644 --- a/Content.Server/Vehicle/VehicleSystem.cs +++ b/Content.Server/Vehicle/VehicleSystem.cs @@ -12,6 +12,8 @@ using Content.Shared.Tag; using Content.Shared.Movement.Systems; using Robust.Shared.Audio; using Robust.Shared.Containers; +using Robust.Shared.Physics; +using Robust.Shared.Physics.Systems; using Robust.Shared.Player; using DrawDepth = Content.Shared.DrawDepth.DrawDepth; @@ -20,10 +22,10 @@ namespace Content.Server.Vehicle public sealed partial class VehicleSystem : SharedVehicleSystem { [Dependency] private readonly HandVirtualItemSystem _virtualItemSystem = default!; - [Dependency] private readonly MetaDataSystem _metadata = default!; [Dependency] private readonly MovementSpeedModifierSystem _modifier = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly SharedAmbientSoundSystem _ambientSound = default!; + [Dependency] private readonly SharedJointSystem _joints = default!; [Dependency] private readonly SharedMoverController _mover = default!; [Dependency] private readonly TagSystem _tagSystem = default!; @@ -112,6 +114,11 @@ namespace Content.Server.Vehicle _actionsSystem.AddAction(args.BuckledEntity, component.HornAction, uid, actions); } + if (TryComp(args.BuckledEntity, out var joints)) + { + _joints.ClearJoints(joints); + } + return; }