diff --git a/Content.Client/Weapons/Ranged/Systems/TetherGunSystem.cs b/Content.Client/Weapons/Ranged/Systems/TetherGunSystem.cs index 9c3e214e19..9b56fdd8d7 100644 --- a/Content.Client/Weapons/Ranged/Systems/TetherGunSystem.cs +++ b/Content.Client/Weapons/Ranged/Systems/TetherGunSystem.cs @@ -17,7 +17,6 @@ public sealed class TetherGunSystem : SharedTetherGunSystem [Dependency] private readonly IEyeManager _eyeManager = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IInputManager _inputManager = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly InputSystem _inputSystem = default!; public bool Enabled { get; set; } @@ -85,15 +84,10 @@ public sealed class TetherGunSystem : SharedTetherGunSystem if (gameState is GameplayState game) { - EntityUid? uid; + var uid = game.GetEntityUnderPosition(mousePos); - foreach (var ent in _lookup.GetEntitiesIntersecting(mousePos, LookupFlags.Approximate | LookupFlags.Static)) - { - uid = game.GetEntityUnderPosition(mousePos); - - if (uid != null) - StartDragging(uid.Value, mousePos); - } + if (uid != null) + StartDragging(uid.Value, mousePos); } if (_dragging == null) diff --git a/Content.IntegrationTests/Tests/PrototypeSaveTest.cs b/Content.IntegrationTests/Tests/PrototypeSaveTest.cs index 9388a8a1ef..86cd8cbc18 100644 --- a/Content.IntegrationTests/Tests/PrototypeSaveTest.cs +++ b/Content.IntegrationTests/Tests/PrototypeSaveTest.cs @@ -54,7 +54,6 @@ public sealed class PrototypeSaveTest "SignalSwitch", "SignalButton", "ApcNetSwitch", - "TetherEntity", "SignalButtonExt1", "SignalButtonExt2", "SignalButtonExt3", diff --git a/Content.Server/Weapons/Ranged/Systems/TetherGunSystem.cs b/Content.Server/Weapons/Ranged/Systems/TetherGunSystem.cs index 113a58f44c..5b9b73fdca 100644 --- a/Content.Server/Weapons/Ranged/Systems/TetherGunSystem.cs +++ b/Content.Server/Weapons/Ranged/Systems/TetherGunSystem.cs @@ -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 _tethered = new(); private readonly HashSet _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); } } diff --git a/Resources/Prototypes/Entities/Virtual/tether.yml b/Resources/Prototypes/Entities/Virtual/tether.yml index 31695f220e..bab8124738 100644 --- a/Resources/Prototypes/Entities/Virtual/tether.yml +++ b/Resources/Prototypes/Entities/Virtual/tether.yml @@ -3,4 +3,10 @@ noSpawn: true components: - type: Physics + bodyType: Dynamic - type: Fixtures + fixtures: + - shape: + !type:PhysShapeCircle + radius: 0.35 + id: tether