diff --git a/Content.Server/Body/Components/BrainComponent.cs b/Content.Server/Body/Components/BrainComponent.cs deleted file mode 100644 index 004ff24eaff69..0000000000000 --- a/Content.Server/Body/Components/BrainComponent.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Content.Server.Body.Systems; - -namespace Content.Server.Body.Components -{ - [RegisterComponent, Access(typeof(BrainSystem))] - public sealed partial class BrainComponent : Component - { - } -} diff --git a/Content.Server/Ghost/Components/GhostOnMoveComponent.cs b/Content.Server/Ghost/Components/GhostOnMoveComponent.cs deleted file mode 100644 index e3abc976885dc..0000000000000 --- a/Content.Server/Ghost/Components/GhostOnMoveComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Content.Server.Ghost.Components -{ - [RegisterComponent] - public sealed partial class GhostOnMoveComponent : Component - { - [DataField("canReturn")] public bool CanReturn { get; set; } = true; - - [DataField("mustBeDead")] - public bool MustBeDead = false; - } -} diff --git a/Content.Shared/Body/Components/BrainComponent.cs b/Content.Shared/Body/Components/BrainComponent.cs new file mode 100644 index 0000000000000..be3c3ecbe5a1a --- /dev/null +++ b/Content.Shared/Body/Components/BrainComponent.cs @@ -0,0 +1,6 @@ +using Content.Shared.Body.Systems; + +namespace Content.Shared.Body.Components; + +[RegisterComponent, Access(typeof(BrainSystem))] +public sealed partial class BrainComponent : Component; diff --git a/Content.Server/Body/Systems/BrainSystem.cs b/Content.Shared/Body/Systems/BrainSystem.cs similarity index 84% rename from Content.Server/Body/Systems/BrainSystem.cs rename to Content.Shared/Body/Systems/BrainSystem.cs index e916849a8161a..d79dbe8d48df1 100644 --- a/Content.Server/Body/Systems/BrainSystem.cs +++ b/Content.Shared/Body/Systems/BrainSystem.cs @@ -1,12 +1,12 @@ -using Content.Server.Body.Components; -using Content.Server.Ghost.Components; +using Content.Shared.Body.Components; using Content.Shared.Body.Events; +using Content.Shared.Ghost; using Content.Shared.Mind; using Content.Shared.Mind.Components; using Content.Shared.Mobs.Components; using Content.Shared.Pointing; -namespace Content.Server.Body.Systems; +namespace Content.Shared.Body.Systems; public sealed class BrainSystem : EntitySystem { @@ -14,8 +14,6 @@ public sealed class BrainSystem : EntitySystem public override void Initialize() { - base.Initialize(); - SubscribeLocalEvent((uid, _, args) => HandleMind(args.Body, uid)); SubscribeLocalEvent((uid, _, args) => HandleMind(uid, args.OldBody)); SubscribeLocalEvent(OnPointAttempt); @@ -31,6 +29,7 @@ private void HandleMind(EntityUid newEntity, EntityUid oldEntity) var ghostOnMove = EnsureComp(newEntity); ghostOnMove.MustBeDead = HasComp(newEntity); // Don't ghost living players out of their bodies. + Dirty(newEntity, ghostOnMove); if (!_mindSystem.TryGetMind(oldEntity, out var mindId, out var mind)) return; @@ -38,9 +37,8 @@ private void HandleMind(EntityUid newEntity, EntityUid oldEntity) _mindSystem.TransferTo(mindId, newEntity, mind: mind); } - private void OnPointAttempt(Entity ent, ref PointAttemptEvent args) + private static void OnPointAttempt(Entity ent, ref PointAttemptEvent args) { args.Cancel(); } } - diff --git a/Content.Shared/Ghost/GhostOnMoveComponent.cs b/Content.Shared/Ghost/GhostOnMoveComponent.cs new file mode 100644 index 0000000000000..ab27421dd4cd9 --- /dev/null +++ b/Content.Shared/Ghost/GhostOnMoveComponent.cs @@ -0,0 +1,13 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Ghost; + +[RegisterComponent, NetworkedComponent] +public sealed partial class GhostOnMoveComponent : Component +{ + [DataField] + public bool CanReturn { get; set; } = true; + + [DataField] + public bool MustBeDead; +}