Remove IRelayMoveInput (#4663)

* Remove IRelayMoveInput

This interface gets called every time a movement key is pressed so it gets called a lot.

* Remove RelayMovementEntityMessage

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-09-20 19:06:48 +10:00
committed by GitHub
parent fcc1217e5d
commit 578ed16b8f
16 changed files with 179 additions and 174 deletions

View File

@@ -10,19 +10,10 @@ namespace Content.Server.Ghost.Components
{
[RegisterComponent]
[ComponentReference(typeof(IGhostOnMove))]
public class GhostOnMoveComponent : Component, IRelayMoveInput, IGhostOnMove
public class GhostOnMoveComponent : Component,IGhostOnMove
{
public override string Name => "GhostOnMove";
[DataField("canReturn")] public bool CanReturn { get; set; } = true;
void IRelayMoveInput.MoveInputPressed(ICommonSession session)
{
// Let's not ghost if our mind is visiting...
if (Owner.HasComponent<VisitingMindComponent>()) return;
if (!Owner.TryGetComponent(out MindComponent? mind) || !mind.HasMind || mind.Mind!.IsVisitingEntity) return;
EntitySystem.Get<GameTicker>().OnGhostAttempt(mind.Mind!, CanReturn);
}
}
}