Fix tethergun (#13163)
This commit is contained in:
@@ -21,6 +21,7 @@ public sealed class TetherGunSystem : SharedTetherGunSystem
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly SharedJointSystem _joints = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
|
||||
private readonly Dictionary<ICommonSession, (EntityUid Entity, EntityUid Tether, Joint Joint)> _tethered = new();
|
||||
private readonly HashSet<ICommonSession> _draggers = new();
|
||||
@@ -113,6 +114,8 @@ public sealed class TetherGunSystem : SharedTetherGunSystem
|
||||
body.BodyStatus = BodyStatus.InAir;
|
||||
}
|
||||
|
||||
_physics.WakeBody(bodyA);
|
||||
_physics.WakeBody(bodyB);
|
||||
var joint = _joints.CreateMouseJoint(bodyA.Owner, bodyB.Owner, id: JointId);
|
||||
|
||||
SharedJointSystem.LinearStiffness(5f, 0.7f, bodyA.Mass, bodyB.Mass, out var stiffness, out var damping);
|
||||
@@ -183,7 +186,7 @@ public sealed class TetherGunSystem : SharedTetherGunSystem
|
||||
// Force it awake, always
|
||||
if (bodyQuery.TryGetComponent(entity.Entity, out var body))
|
||||
{
|
||||
body.WakeBody();
|
||||
_physics.WakeBody(body);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user