Move OnGhostAttempt to GhostSystem (#31445)

* Move OnGhostAttempt to GhostSystem

* Remove unused dependencies and sort them
This commit is contained in:
Winkarst
2024-08-26 15:15:33 +03:00
committed by GitHub
parent 84caaec674
commit 2d85b4e7e9
10 changed files with 156 additions and 158 deletions

View 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);