]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Move OnGhostAttempt to GhostSystem (#31445)
authorWinkarst <74284083+Winkarst-cpu@users.noreply.github.com>
Mon, 26 Aug 2024 12:15:33 +0000 (15:15 +0300)
committerGitHub <noreply@github.com>
Mon, 26 Aug 2024 12:15:33 +0000 (14:15 +0200)
* Move OnGhostAttempt to GhostSystem

* Remove unused dependencies and sort them

Content.Server/Bed/Cryostorage/CryostorageSystem.cs
Content.Server/Body/Systems/BodySystem.cs
Content.Server/Chat/SuicideSystem.cs
Content.Server/Clothing/Systems/CursedMaskSystem.cs
Content.Server/GameTicking/GameTicker.GamePreset.cs
Content.Server/Ghost/GhostCommand.cs
Content.Server/Ghost/GhostSystem.cs
Content.Server/Materials/MaterialReclaimerSystem.cs
Content.Server/Mind/MindSystem.cs
Content.Server/Morgue/CrematoriumSystem.cs

index 1369fa20f11560ad1048b37ae3e9291033196ddd..dd89ba2f72e825bc3848c9a92f06f4d4e1fb1efb 100644 (file)
@@ -1,17 +1,14 @@
-using System.Globalization;
-using System.Linq;
 using Content.Server.Chat.Managers;
+using Content.Server.Chat.Systems;
 using Content.Server.GameTicking;
+using Content.Server.Ghost;
 using Content.Server.Hands.Systems;
 using Content.Server.Inventory;
 using Content.Server.Popups;
-using Content.Server.Chat.Systems;
 using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
 using Content.Server.StationRecords;
 using Content.Server.StationRecords.Systems;
-using Content.Shared.StationRecords;
-using Content.Shared.UserInterface;
 using Content.Shared.Access.Systems;
 using Content.Shared.Bed.Cryostorage;
 using Content.Shared.Chat;
@@ -19,6 +16,8 @@ using Content.Shared.Climbing.Systems;
 using Content.Shared.Database;
 using Content.Shared.Hands.Components;
 using Content.Shared.Mind.Components;
+using Content.Shared.StationRecords;
+using Content.Shared.UserInterface;
 using Robust.Server.Audio;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
@@ -27,6 +26,7 @@ using Robust.Shared.Containers;
 using Robust.Shared.Enums;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
+using System.Globalization;
 
 namespace Content.Server.Bed.Cryostorage;
 
@@ -40,7 +40,7 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
     [Dependency] private readonly ChatSystem _chatSystem = default!;
     [Dependency] private readonly ClimbSystem _climb = default!;
     [Dependency] private readonly ContainerSystem _container = default!;
-    [Dependency] private readonly GameTicker _gameTicker = default!;
+    [Dependency] private readonly GhostSystem _ghostSystem = default!;
     [Dependency] private readonly HandsSystem _hands = default!;
     [Dependency] private readonly ServerInventorySystem _inventory = default!;
     [Dependency] private readonly PopupSystem _popup = default!;
@@ -210,7 +210,7 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
             if (userId != null && Mind.TryGetMind(userId.Value, out var mind) &&
                 HasComp<CryostorageContainedComponent>(mind.Value.Comp.CurrentEntity))
             {
-                _gameTicker.OnGhostAttempt(mind.Value, false);
+                _ghostSystem.OnGhostAttempt(mind.Value, false);
             }
         }
 
index bd5edb0ea50da2170c284c23bb727a654074b3e9..4279f3ed2b89de5bd1bcd3ef143e29ca997eebff 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Server.Body.Components;
-using Content.Server.GameTicking;
+using Content.Server.Ghost;
 using Content.Server.Humanoid;
 using Content.Shared.Body.Components;
 using Content.Shared.Body.Part;
@@ -17,7 +17,7 @@ namespace Content.Server.Body.Systems;
 
 public sealed class BodySystem : SharedBodySystem
 {
-    [Dependency] private readonly GameTicker _ticker = default!;
+    [Dependency] private readonly GhostSystem _ghostSystem = default!;
     [Dependency] private readonly IGameTiming _gameTiming = default!;
     [Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!;
     [Dependency] private readonly MobStateSystem _mobState = default!;
@@ -43,7 +43,7 @@ public sealed class BodySystem : SharedBodySystem
         if (_mobState.IsDead(ent) && _mindSystem.TryGetMind(ent, out var mindId, out var mind))
         {
             mind.TimeOfDeath ??= _gameTiming.RealTime;
-            _ticker.OnGhostAttempt(mindId, canReturnGlobal: true, mind: mind);
+            _ghostSystem.OnGhostAttempt(mindId, canReturnGlobal: true, mind: mind);
         }
     }
 
index 884292b0fa7320898fa17ba4bf2a66e3fef0162f..69d87472fb24d2185916c04e2251a326c347a729 100644 (file)
@@ -1,18 +1,18 @@
-using Content.Server.GameTicking;
+using Content.Server.Ghost;
+using Content.Shared.Administration.Logs;
+using Content.Shared.Chat;
 using Content.Shared.Damage;
 using Content.Shared.Database;
 using Content.Shared.Hands.Components;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Item;
 using Content.Shared.Mind;
+using Content.Shared.Mind.Components;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Robust.Shared.Player;
-using Content.Shared.Administration.Logs;
-using Content.Shared.Chat;
-using Content.Shared.Mind.Components;
 
 namespace Content.Server.Chat;
 
@@ -23,7 +23,7 @@ public sealed class SuicideSystem : EntitySystem
     [Dependency] private readonly TagSystem _tagSystem = default!;
     [Dependency] private readonly MobStateSystem _mobState = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
-    [Dependency] private readonly GameTicker _gameTicker = default!;
+    [Dependency] private readonly GhostSystem _ghostSystem = default!;
     [Dependency] private readonly SharedSuicideSystem _suicide = default!;
 
     public override void Initialize()
@@ -82,7 +82,7 @@ public sealed class SuicideSystem : EntitySystem
         if (_tagSystem.HasTag(victim, "CannotSuicide"))
             args.CanReturnToBody = true;
 
-        if (_gameTicker.OnGhostAttempt(victim.Comp.Mind.Value, args.CanReturnToBody, mind: mindComponent))
+        if (_ghostSystem.OnGhostAttempt(victim.Comp.Mind.Value, args.CanReturnToBody, mind: mindComponent))
             args.Handled = true;
     }
 
index 2045ff5ccd67440925b7748c1605041e5066678a..825e85e2c600ccdab403e7fec10d2c30371fb3f5 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Server.Administration.Logs;
-using Content.Server.GameTicking;
+using Content.Server.Ghost;
 using Content.Server.Mind;
 using Content.Server.NPC;
 using Content.Server.NPC.HTN;
@@ -21,7 +21,7 @@ namespace Content.Server.Clothing.Systems;
 public sealed class CursedMaskSystem : SharedCursedMaskSystem
 {
     [Dependency] private readonly IAdminLogManager _adminLog = default!;
-    [Dependency] private readonly GameTicker _ticker = default!;
+    [Dependency] private readonly GhostSystem _ghostSystem = default!;
     [Dependency] private readonly HTNSystem _htn = default!;
     [Dependency] private readonly MindSystem _mind = default!;
     [Dependency] private readonly NPCSystem _npc = default!;
@@ -39,7 +39,7 @@ public sealed class CursedMaskSystem : SharedCursedMaskSystem
         if (TryComp<ActorComponent>(wearer, out var actor) && actor.PlayerSession.GetMind() is { } mind)
         {
             var session = actor.PlayerSession;
-            if (!_ticker.OnGhostAttempt(mind, false))
+            if (!_ghostSystem.OnGhostAttempt(mind, false))
                 return;
 
             ent.Comp.StolenMind = mind;
index 5a2b375dd68c88fe206dd5da2b19065d0e308ff6..5642e84f90820842dc29fb2f3d6ab3a15f63142b 100644 (file)
@@ -1,27 +1,16 @@
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Threading.Tasks;
 using Content.Server.GameTicking.Presets;
 using Content.Server.Maps;
 using Content.Shared.CCVar;
-using Content.Shared.Damage;
-using Content.Shared.Damage.Prototypes;
-using Content.Shared.Database;
-using Content.Shared.FixedPoint;
-using Content.Shared.Ghost;
-using Content.Shared.Mind;
-using Content.Shared.Mobs;
-using Content.Shared.Mobs.Components;
-using Content.Shared.Mobs.Systems;
 using JetBrains.Annotations;
 using Robust.Shared.Player;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Threading.Tasks;
 
 namespace Content.Server.GameTicking
 {
     public sealed partial class GameTicker
     {
-        [Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!;
-
         public const float PresetFailedCooldownIncrease = 30f;
 
         /// <summary>
@@ -198,94 +187,6 @@ namespace Content.Server.GameTicking
             }
         }
 
-        public bool OnGhostAttempt(EntityUid mindId, bool canReturnGlobal, bool viaCommand = false, MindComponent? mind = null)
-        {
-            if (!Resolve(mindId, ref mind))
-                return false;
-
-            var playerEntity = mind.CurrentEntity;
-
-            if (playerEntity != null && viaCommand)
-                _adminLogger.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} is attempting to ghost via command");
-
-            var handleEv = new GhostAttemptHandleEvent(mind, canReturnGlobal);
-            RaiseLocalEvent(handleEv);
-
-            // Something else has handled the ghost attempt for us! We return its result.
-            if (handleEv.Handled)
-                return handleEv.Result;
-
-            if (mind.PreventGhosting)
-            {
-                if (mind.Session != null) // Logging is suppressed to prevent spam from ghost attempts caused by movement attempts
-                {
-                    _chatManager.DispatchServerMessage(mind.Session, Loc.GetString("comp-mind-ghosting-prevented"),
-                        true);
-                }
-
-                return false;
-            }
-
-            if (TryComp<GhostComponent>(playerEntity, out var comp) && !comp.CanGhostInteract)
-                return false;
-
-            if (mind.VisitingEntity != default)
-            {
-                _mind.UnVisit(mindId, mind: mind);
-            }
-
-            var position = Exists(playerEntity)
-                ? Transform(playerEntity.Value).Coordinates
-                : GetObserverSpawnPoint();
-
-            if (position == default)
-                return false;
-
-            // Ok, so, this is the master place for the logic for if ghosting is "too cheaty" to allow returning.
-            // There's no reason at this time to move it to any other place, especially given that the 'side effects required' situations would also have to be moved.
-            // + If CharacterDeadPhysically applies, we're physically dead. Therefore, ghosting OK, and we can return (this is critical for gibbing)
-            //   Note that we could theoretically be ICly dead and still physically alive and vice versa.
-            //   (For example, a zombie could be dead ICly, but may retain memories and is definitely physically active)
-            // + If we're in a mob that is critical, and we're supposed to be able to return if possible,
-            //   we're succumbing - the mob is killed. Therefore, character is dead. Ghosting OK.
-            //   (If the mob survives, that's a bug. Ghosting is kept regardless.)
-            var canReturn = canReturnGlobal && _mind.IsCharacterDeadPhysically(mind);
-
-            if (_configurationManager.GetCVar(CCVars.GhostKillCrit) &&
-                canReturnGlobal &&
-                TryComp(playerEntity, out MobStateComponent? mobState))
-            {
-                if (_mobState.IsCritical(playerEntity.Value, mobState))
-                {
-                    canReturn = true;
-
-                    //todo: what if they dont breathe lol
-                    //cry deeply
-
-                    FixedPoint2 dealtDamage = 200;
-                    if (TryComp<DamageableComponent>(playerEntity, out var damageable)
-                        && TryComp<MobThresholdsComponent>(playerEntity, out var thresholds))
-                    {
-                        var playerDeadThreshold = _mobThresholdSystem.GetThresholdForState(playerEntity.Value, MobState.Dead, thresholds);
-                        dealtDamage = playerDeadThreshold - damageable.TotalDamage;
-                    }
-
-                    DamageSpecifier damage = new(_prototypeManager.Index<DamageTypePrototype>("Asphyxiation"), dealtDamage);
-
-                    _damageable.TryChangeDamage(playerEntity, damage, true);
-                }
-            }
-
-            var ghost = _ghost.SpawnGhost((mindId, mind), position, canReturn);
-            if (ghost == null)
-                return false;
-
-            if (playerEntity != null)
-                _adminLogger.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} ghosted{(!canReturn ? " (non-returnable)" : "")}");
-
-            return true;
-        }
-
         private void IncrementRoundNumber()
         {
             var playerIds = _playerGameStatuses.Keys.Select(player => player.UserId).ToArray();
@@ -304,17 +205,4 @@ namespace Content.Server.GameTicking
             RoundId = task.GetAwaiter().GetResult();
         }
     }
-
-    public sealed class GhostAttemptHandleEvent : HandledEntityEventArgs
-    {
-        public MindComponent Mind { get; }
-        public bool CanReturnGlobal { get; }
-        public bool Result { get; set; }
-
-        public GhostAttemptHandleEvent(MindComponent mind, bool canReturnGlobal)
-        {
-            Mind = mind;
-            CanReturnGlobal = canReturnGlobal;
-        }
-    }
 }
index b553d64201a758379d1f3a6b8ee1ca104eeb41a9..a2f361d29dbdc29fa69aa42d04d52431d8d3fc4d 100644 (file)
@@ -1,4 +1,3 @@
-using Content.Server.GameTicking;
 using Content.Server.Popups;
 using Content.Shared.Administration;
 using Content.Shared.Mind;
@@ -41,7 +40,7 @@ namespace Content.Server.Ghost
                 mind = _entities.GetComponent<MindComponent>(mindId);
             }
 
-            if (!_entities.System<GameTicker>().OnGhostAttempt(mindId, true, true, mind))
+            if (!_entities.System<GhostSystem>().OnGhostAttempt(mindId, true, true, mind))
             {
                 shell.WriteLine(Loc.GetString("ghost-command-denied"));
             }
index b68c279b3e5a9869a545abe0cffc69f2b55571cb..b045214329757005252ca0d1e9592651bd452909 100644 (file)
@@ -1,17 +1,23 @@
-using System.Linq;
-using System.Numerics;
+using Content.Server.Administration.Logs;
+using Content.Server.Chat.Managers;
 using Content.Server.GameTicking;
 using Content.Server.Ghost.Components;
 using Content.Server.Mind;
 using Content.Server.Roles.Jobs;
 using Content.Server.Warps;
 using Content.Shared.Actions;
+using Content.Shared.CCVar;
+using Content.Shared.Damage;
+using Content.Shared.Damage.Prototypes;
+using Content.Shared.Database;
 using Content.Shared.Examine;
 using Content.Shared.Eye;
+using Content.Shared.FixedPoint;
 using Content.Shared.Follower;
 using Content.Shared.Ghost;
 using Content.Shared.Mind;
 using Content.Shared.Mind.Components;
+using Content.Shared.Mobs;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using Content.Shared.Movement.Events;
@@ -19,11 +25,15 @@ using Content.Shared.Movement.Systems;
 using Content.Shared.Storage.Components;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
+using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
+using System.Linq;
+using System.Numerics;
 
 namespace Content.Server.Ghost
 {
@@ -44,6 +54,14 @@ namespace Content.Server.Ghost
         [Dependency] private readonly TransformSystem _transformSystem = default!;
         [Dependency] private readonly VisibilitySystem _visibilitySystem = default!;
         [Dependency] private readonly MetaDataSystem _metaData = default!;
+        [Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!;
+        [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+        [Dependency] private readonly IAdminLogManager _adminLogger = default!;
+        [Dependency] private readonly IConfigurationManager _configurationManager = default!;
+        [Dependency] private readonly IChatManager _chatManager = default!;
+        [Dependency] private readonly SharedMindSystem _mind = default!;
+        [Dependency] private readonly GameTicker _gameTicker = default!;
+        [Dependency] private readonly DamageableSystem _damageable = default!;
 
         private EntityQuery<GhostComponent> _ghostQuery;
         private EntityQuery<PhysicsComponent> _physicsQuery;
@@ -144,7 +162,7 @@ namespace Content.Server.Ghost
             if (component.MustBeDead && (_mobState.IsAlive(uid) || _mobState.IsCritical(uid)))
                 return;
 
-            _ticker.OnGhostAttempt(mindId, component.CanReturn, mind: mind);
+            OnGhostAttempt(mindId, component.CanReturn, mind: mind);
         }
 
         private void OnGhostStartup(EntityUid uid, GhostComponent component, ComponentStartup args)
@@ -473,5 +491,102 @@ namespace Content.Server.Ghost
             Log.Debug($"Spawned ghost \"{ToPrettyString(ghost)}\" for {mind.Comp.CharacterName}.");
             return ghost;
         }
+
+        public bool OnGhostAttempt(EntityUid mindId, bool canReturnGlobal, bool viaCommand = false, MindComponent? mind = null)
+        {
+            if (!Resolve(mindId, ref mind))
+                return false;
+
+            var playerEntity = mind.CurrentEntity;
+
+            if (playerEntity != null && viaCommand)
+                _adminLogger.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} is attempting to ghost via command");
+
+            var handleEv = new GhostAttemptHandleEvent(mind, canReturnGlobal);
+            RaiseLocalEvent(handleEv);
+
+            // Something else has handled the ghost attempt for us! We return its result.
+            if (handleEv.Handled)
+                return handleEv.Result;
+
+            if (mind.PreventGhosting)
+            {
+                if (mind.Session != null) // Logging is suppressed to prevent spam from ghost attempts caused by movement attempts
+                {
+                    _chatManager.DispatchServerMessage(mind.Session, Loc.GetString("comp-mind-ghosting-prevented"),
+                        true);
+                }
+
+                return false;
+            }
+
+            if (TryComp<GhostComponent>(playerEntity, out var comp) && !comp.CanGhostInteract)
+                return false;
+
+            if (mind.VisitingEntity != default)
+            {
+                _mind.UnVisit(mindId, mind: mind);
+            }
+
+            var position = Exists(playerEntity)
+                ? Transform(playerEntity.Value).Coordinates
+                : _gameTicker.GetObserverSpawnPoint();
+
+            if (position == default)
+                return false;
+
+            // Ok, so, this is the master place for the logic for if ghosting is "too cheaty" to allow returning.
+            // There's no reason at this time to move it to any other place, especially given that the 'side effects required' situations would also have to be moved.
+            // + If CharacterDeadPhysically applies, we're physically dead. Therefore, ghosting OK, and we can return (this is critical for gibbing)
+            //   Note that we could theoretically be ICly dead and still physically alive and vice versa.
+            //   (For example, a zombie could be dead ICly, but may retain memories and is definitely physically active)
+            // + If we're in a mob that is critical, and we're supposed to be able to return if possible,
+            //   we're succumbing - the mob is killed. Therefore, character is dead. Ghosting OK.
+            //   (If the mob survives, that's a bug. Ghosting is kept regardless.)
+            var canReturn = canReturnGlobal && _mind.IsCharacterDeadPhysically(mind);
+
+            if (_configurationManager.GetCVar(CCVars.GhostKillCrit) &&
+                canReturnGlobal &&
+                TryComp(playerEntity, out MobStateComponent? mobState))
+            {
+                if (_mobState.IsCritical(playerEntity.Value, mobState))
+                {
+                    canReturn = true;
+
+                    //todo: what if they dont breathe lol
+                    //cry deeply
+
+                    FixedPoint2 dealtDamage = 200;
+
+                    if (TryComp<DamageableComponent>(playerEntity, out var damageable)
+                        && TryComp<MobThresholdsComponent>(playerEntity, out var thresholds))
+                    {
+                        var playerDeadThreshold = _mobThresholdSystem.GetThresholdForState(playerEntity.Value, MobState.Dead, thresholds);
+                        dealtDamage = playerDeadThreshold - damageable.TotalDamage;
+                    }
+
+                    DamageSpecifier damage = new(_prototypeManager.Index<DamageTypePrototype>("Asphyxiation"), dealtDamage);
+
+                    _damageable.TryChangeDamage(playerEntity, damage, true);
+                }
+            }
+
+            var ghost = SpawnGhost((mindId, mind), position, canReturn);
+
+            if (ghost == null)
+                return false;
+
+            if (playerEntity != null)
+                _adminLogger.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} ghosted{(!canReturn ? " (non-returnable)" : "")}");
+
+            return true;
+        }
+    }
+
+    public sealed class GhostAttemptHandleEvent(MindComponent mind, bool canReturnGlobal) : HandledEntityEventArgs
+    {
+        public MindComponent Mind { get; } = mind;
+        public bool CanReturnGlobal { get; } = canReturnGlobal;
+        public bool Result { get; set; }
     }
 }
index b02212844b0cdbbb34d96fd017baf83be1b1a575..f6abcad7bc2c58da9827731ce6c1b8b0654f9350 100644 (file)
@@ -1,31 +1,29 @@
-using Content.Server.Chemistry.Containers.EntitySystems;
+using Content.Server.Administration.Logs;
 using Content.Server.Fluids.EntitySystems;
-using Content.Server.GameTicking;
+using Content.Server.Ghost;
 using Content.Server.Popups;
-using Content.Server.Power.Components;
+using Content.Server.Repairable;
 using Content.Server.Stack;
 using Content.Server.Wires;
 using Content.Shared.Body.Systems;
 using Content.Shared.Chemistry.Components;
 using Content.Shared.Chemistry.Components.SolutionManager;
 using Content.Shared.Chemistry.EntitySystems;
+using Content.Shared.Database;
+using Content.Shared.Destructible;
+using Content.Shared.Emag.Components;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Materials;
 using Content.Shared.Mind;
 using Content.Shared.Nutrition.EntitySystems;
+using Content.Shared.Power;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 using System.Linq;
-using Content.Server.Administration.Logs;
-using Content.Server.Repairable;
-using Content.Shared.Database;
-using Content.Shared.Destructible;
-using Content.Shared.Emag.Components;
-using Content.Shared.Power;
-using Robust.Shared.Prototypes;
 
 namespace Content.Server.Materials;
 
@@ -34,7 +32,7 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
 {
     [Dependency] private readonly IPrototypeManager _prototype = default!;
     [Dependency] private readonly AppearanceSystem _appearance = default!;
-    [Dependency] private readonly GameTicker _ticker = default!;
+    [Dependency] private readonly GhostSystem _ghostSystem = default!;
     [Dependency] private readonly MaterialStorageSystem _materialStorage = default!;
     [Dependency] private readonly OpenableSystem _openable = default!;
     [Dependency] private readonly PopupSystem _popup = default!;
@@ -99,7 +97,7 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
         if (TryComp(victim, out ActorComponent? actor) &&
             _mind.TryGetMind(actor.PlayerSession, out var mindId, out var mind))
         {
-            _ticker.OnGhostAttempt(mindId, false, mind: mind);
+            _ghostSystem.OnGhostAttempt(mindId, false, mind: mind);
             if (mind.OwnedEntity is { Valid: true } suicider)
             {
                 _popup.PopupEntity(Loc.GetString("recycler-component-suicide-message"), suicider);
index 4271d76b445916d1e7def9efc59805f1ec40517d..c3e29cc3635e14bfa2f4e2b51d03a09d945bc31c 100644 (file)
@@ -1,4 +1,3 @@
-using System.Diagnostics.CodeAnalysis;
 using Content.Server.Administration.Logs;
 using Content.Server.GameTicking;
 using Content.Server.Ghost;
@@ -13,6 +12,7 @@ using Robust.Server.Player;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
 using Robust.Shared.Utility;
+using System.Diagnostics.CodeAnalysis;
 
 namespace Content.Server.Mind;
 
@@ -194,7 +194,7 @@ public sealed class MindSystem : SharedMindSystem
             component = EnsureComp<MindContainerComponent>(entity.Value);
 
             if (component.HasMind)
-                _gameTicker.OnGhostAttempt(component.Mind.Value, false);
+                _ghosts.OnGhostAttempt(component.Mind.Value, false);
 
             if (TryComp<ActorComponent>(entity.Value, out var actor))
             {
index f6859b610af7dd5b76b03f2873131397867745a1..656457dc985650c53c050a34a3bf3ee41da3c27e 100644 (file)
@@ -1,4 +1,4 @@
-using Content.Server.GameTicking;
+using Content.Server.Ghost;
 using Content.Server.Morgue.Components;
 using Content.Server.Storage.Components;
 using Content.Server.Storage.EntitySystems;
@@ -13,8 +13,6 @@ using Content.Shared.Standing;
 using Content.Shared.Storage;
 using Content.Shared.Storage.Components;
 using Content.Shared.Verbs;
-using Robust.Server.GameObjects;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
@@ -25,7 +23,7 @@ public sealed class CrematoriumSystem : EntitySystem
 {
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
-    [Dependency] private readonly GameTicker _ticker = default!;
+    [Dependency] private readonly GhostSystem _ghostSystem = default!;
     [Dependency] private readonly EntityStorageSystem _entityStorage = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly StandingStateSystem _standing = default!;
@@ -154,7 +152,7 @@ public sealed class CrematoriumSystem : EntitySystem
         var victim = args.Victim;
         if (TryComp(victim, out ActorComponent? actor) && _minds.TryGetMind(victim, out var mindId, out var mind))
         {
-            _ticker.OnGhostAttempt(mindId, false, mind: mind);
+            _ghostSystem.OnGhostAttempt(mindId, false, mind: mind);
 
             if (mind.OwnedEntity is { Valid: true } entity)
             {