Files
tbd-station-14/Content.Client/GameObjects/EntitySystems/PullingSystem.cs
DrSmugleaf 4c47cd4fe2 Add back pull moving (#3635)
* Add back pull moving

* Make pull moving event-based, use map coordinates, slow down moving when getting closer and stop moving when very close, add max range and add compensation for overshooting

* Remove compensation

* Prevent pull move from pulling you

* acruid did this

* Add unsubscriptions to shutdown

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2021-04-05 14:08:45 +02:00

31 lines
986 B
C#

using Content.Client.GameObjects.Components.Pulling;
using Content.Shared.GameObjects.EntitySystemMessages.Pulling;
using Content.Shared.GameObjects.EntitySystems;
using JetBrains.Annotations;
using Robust.Client.Physics;
namespace Content.Client.GameObjects.EntitySystems
{
[UsedImplicitly]
public class PullingSystem : SharedPullingSystem
{
public override void Initialize()
{
base.Initialize();
UpdatesAfter.Add(typeof(PhysicsSystem));
SubscribeLocalEvent<PullableComponent, PullableMoveMessage>(OnPullableMove);
SubscribeLocalEvent<PullableComponent, PullableStopMovingMessage>(OnPullableStopMove);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<PullableComponent, PullableMoveMessage>(OnPullableMove);
UnsubscribeLocalEvent<PullableComponent, PullableStopMovingMessage>(OnPullableStopMove);
}
}
}