* Migrate lots of pulling logic out of the components and clean it up * It's buggy, but move more code out of the pullable component * Pulling system now throws less errors than it did before the refactor * Finally finish the big parts of refactoring pullability * Pulling: Handle disconnect properly if the pull joint has been removed by physics shutdown * Port2b68449328to this branch * Changes as per PR reviews * Porte801ffac45(SharedJointSystem) and fix issues encountered during testing SharedJointSystem. Also, MinLength and Stiffness appear to have suddenly gained enough meaning that pulling is broken unless they're set.
29 lines
824 B
C#
29 lines
824 B
C#
using Content.Shared.Alert;
|
|
using Content.Shared.Pulling;
|
|
using Content.Shared.Pulling.Components;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
|
|
|
namespace Content.Server.Alert.Click
|
|
{
|
|
/// <summary>
|
|
/// Stop pulling something
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
[DataDefinition]
|
|
public class StopPulling : IAlertClick
|
|
{
|
|
public void AlertClicked(ClickAlertEventArgs args)
|
|
{
|
|
var ps = EntitySystem.Get<SharedPullingSystem>();
|
|
var playerTargetPullable = ps.GetPulled(args.Player)?
|
|
.GetComponentOrNull<SharedPullableComponent>();
|
|
if (playerTargetPullable != null)
|
|
{
|
|
ps.TryStopPull(playerTargetPullable);
|
|
}
|
|
}
|
|
}
|
|
}
|