ctrl-rclick tweaks (#7170)

This commit is contained in:
metalgearsloth
2022-03-18 14:18:34 +11:00
committed by GitHub
parent 366503fc97
commit 867fa503fb
7 changed files with 39 additions and 209 deletions

View File

@@ -4,11 +4,8 @@ using Content.Shared.Physics.Pull;
using Content.Shared.Pulling.Components;
using Content.Shared.Pulling.Events;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.IoC;
using Robust.Shared.Physics;
using Robust.Shared.Log;
namespace Content.Shared.Pulling
{
@@ -29,12 +26,12 @@ namespace Content.Shared.Pulling
return false;
}
if (!EntityManager.TryGetComponent<IPhysBody?>(pulled, out var _physics))
if (!EntityManager.TryGetComponent<IPhysBody?>(pulled, out var physics))
{
return false;
}
if (_physics.BodyType == BodyType.Static)
if (physics.BodyType == BodyType.Static)
{
return false;
}
@@ -181,7 +178,7 @@ namespace Content.Shared.Pulling
return true;
}
public bool TryMoveTo(SharedPullableComponent pullable, EntityCoordinates to)
public virtual bool TryMoveTo(SharedPullableComponent pullable, EntityCoordinates to)
{
if (pullable.Puller == null)
{
@@ -193,13 +190,8 @@ namespace Content.Shared.Pulling
return false;
}
_pullSm.ForceSetMovingTo(pullable, to);
// Action handled under server
return true;
}
public void StopMoveTo(SharedPullableComponent pullable)
{
_pullSm.ForceSetMovingTo(pullable, null);
}
}
}