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.
This commit is contained in:
parent
56dd294cc1
commit
dd178ef3f5
|
|
@ -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<JointComponent>(args.BuckledEntity, out var joints))
|
||||
{
|
||||
_joints.ClearJoints(joints);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue