Fix H-pulling? (#4425)

In retrospect the answer is easy, but man this took a while.
This commit is contained in:
Leon Friedrich
2021-08-20 15:47:59 +10:00
committed by GitHub
parent 837ec62c3a
commit fcc7ca09ef
2 changed files with 31 additions and 24 deletions

View File

@@ -62,7 +62,6 @@ namespace Content.Shared.Pulling
CommandBinds.Builder
.Bind(ContentKeyFunctions.MovePulledObject, new PointerInputCmdHandler(HandleMovePulledObject))
.Bind(ContentKeyFunctions.ReleasePulledObject, InputCmdHandler.FromDelegate(HandleReleasePulledObject))
.Register<SharedPullingSystem>();
}
@@ -194,28 +193,6 @@ namespace Content.Shared.Pulling
return false;
}
private void HandleReleasePulledObject(ICommonSession? session)
{
var player = session?.AttachedEntity;
if (player == null)
{
return;
}
if (!TryGetPulled(player, out var pulled))
{
return;
}
if (!pulled.TryGetComponent(out SharedPullableComponent? pullable))
{
return;
}
pullable.TryStopPull();
}
private void SetPuller(IEntity puller, IEntity pulled)
{
_pullers[puller] = pulled;