Prevent brains from walking (#15709)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2023-04-29 18:35:28 +12:00
committed by GitHub
parent 56f618e9ff
commit aeebe282d4
12 changed files with 50 additions and 61 deletions

View File

@@ -4,12 +4,16 @@ using Content.Server.Mind.Components;
using Content.Shared.Body.Components;
using Content.Shared.Body.Events;
using Content.Shared.Body.Organ;
using Content.Shared.Body.Part;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
namespace Content.Server.Body.Systems
{
public sealed class BrainSystem : EntitySystem
{
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!;
public override void Initialize()
{
base.Initialize();
@@ -42,7 +46,14 @@ namespace Content.Server.Body.Systems
Comp<GhostOnMoveComponent>(newEntity).MustBeDead = true;
// TODO: This is an awful solution.
EnsureComp<InputMoverComponent>(newEntity);
// Our greatest minds still can't figure out how to allow brains/heads to ghost without giving them the
// ability to move first. I hate this with a passion.
if (!HasComp<InputMoverComponent>(newEntity))
{
AddComp<InputMoverComponent>(newEntity);
var move = EnsureComp<MovementSpeedModifierComponent>(newEntity);
_movementSpeed.ChangeBaseSpeed(newEntity, 0, 0 , 0, move);
}
oldMind.Mind?.TransferTo(newEntity);
}