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

@@ -1,21 +1,15 @@
using Content.Server.GameTicking;
using Content.Server.Ghost;
using Content.Server.Mind.Components;
using Content.Shared.Audio;
using Content.Shared.Body.Components;
using Content.Shared.Body.Part;
using Content.Shared.Body.Slot;
using Content.Shared.MobState;
using Content.Shared.Movement.Components;
using Content.Shared.Random.Helpers;
using Content.Shared.Sound;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Body
@@ -23,7 +17,7 @@ namespace Content.Server.Body
[RegisterComponent]
[ComponentReference(typeof(SharedBodyComponent))]
[ComponentReference(typeof(IGhostOnMove))]
public class BodyComponent : SharedBodyComponent, IRelayMoveInput, IGhostOnMove
public class BodyComponent : SharedBodyComponent, IGhostOnMove
{
private Container _partContainer = default!;
@@ -89,17 +83,6 @@ namespace Content.Server.Body
}
}
void IRelayMoveInput.MoveInputPressed(ICommonSession session)
{
if (Owner.TryGetComponent(out IMobStateComponent? mobState) &&
mobState.IsDead() &&
Owner.TryGetComponent(out MindComponent? mind) &&
mind.HasMind)
{
EntitySystem.Get<GameTicker>().OnGhostAttempt(mind.Mind!, true);
}
}
public override void Gib(bool gibParts = false)
{
base.Gib(gibParts);