Remove telekinesis (#9737)
This commit is contained in:
@@ -10,6 +10,7 @@ using JetBrains.Annotations;
|
|||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Input.Binding;
|
using Robust.Shared.Input.Binding;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
|
|
||||||
namespace Content.Shared.Pulling
|
namespace Content.Shared.Pulling
|
||||||
@@ -41,6 +42,7 @@ namespace Content.Shared.Pulling
|
|||||||
SubscribeLocalEvent<PullStartedMessage>(OnPullStarted);
|
SubscribeLocalEvent<PullStartedMessage>(OnPullStarted);
|
||||||
SubscribeLocalEvent<PullStoppedMessage>(OnPullStopped);
|
SubscribeLocalEvent<PullStoppedMessage>(OnPullStopped);
|
||||||
SubscribeLocalEvent<EntInsertedIntoContainerMessage>(HandleContainerInsert);
|
SubscribeLocalEvent<EntInsertedIntoContainerMessage>(HandleContainerInsert);
|
||||||
|
SubscribeLocalEvent<SharedPullableComponent, JointRemovedEvent>(OnJointRemoved);
|
||||||
|
|
||||||
SubscribeLocalEvent<SharedPullableComponent, PullStartedMessage>(PullableHandlePullStarted);
|
SubscribeLocalEvent<SharedPullableComponent, PullStartedMessage>(PullableHandlePullStarted);
|
||||||
SubscribeLocalEvent<SharedPullableComponent, PullStoppedMessage>(PullableHandlePullStopped);
|
SubscribeLocalEvent<SharedPullableComponent, PullStoppedMessage>(PullableHandlePullStopped);
|
||||||
@@ -52,6 +54,28 @@ namespace Content.Shared.Pulling
|
|||||||
.Register<SharedPullingSystem>();
|
.Register<SharedPullingSystem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnJointRemoved(EntityUid uid, SharedPullableComponent component, JointRemovedEvent args)
|
||||||
|
{
|
||||||
|
if (component.Puller != args.OtherBody.Owner)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Do we have some other join with our Puller?
|
||||||
|
// or alternatively:
|
||||||
|
// TODO track the relevant joint.
|
||||||
|
|
||||||
|
if (TryComp(uid, out JointComponent? joints))
|
||||||
|
{
|
||||||
|
foreach (var jt in joints.GetJoints)
|
||||||
|
{
|
||||||
|
if (jt.BodyAUid == component.Puller || jt.BodyBUid == component.Puller)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// No more joints with puller -> force stop pull.
|
||||||
|
_pullSm.ForceDisconnectPullable(component);
|
||||||
|
}
|
||||||
|
|
||||||
private void AddPullVerbs(EntityUid uid, SharedPullableComponent component, GetVerbsEvent<Verb> args)
|
private void AddPullVerbs(EntityUid uid, SharedPullableComponent component, GetVerbsEvent<Verb> args)
|
||||||
{
|
{
|
||||||
if (!args.CanAccess || !args.CanInteract)
|
if (!args.CanAccess || !args.CanInteract)
|
||||||
|
|||||||
Reference in New Issue
Block a user