Remove MindHelpers, stop using PlayerHelpers.
This commit is contained in:
parent
eeb0adc5cd
commit
a666ddb045
|
|
@ -1,20 +0,0 @@
|
|||
using Content.Server.GameTicking;
|
||||
using Content.Server.Players;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Mind
|
||||
{
|
||||
internal static class MindHelpers
|
||||
{
|
||||
internal static void SendToGhost(this IEntity entity, bool canReturn=false)
|
||||
{
|
||||
var mind = entity.PlayerSession()?.ContentData()?.Mind;
|
||||
|
||||
if (mind == null) return;
|
||||
|
||||
EntitySystem.Get<GameTicker>().OnGhostAttempt(mind, canReturn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ using Content.Shared.Morgue;
|
|||
using Content.Shared.Popups;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Standing;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
|
@ -131,9 +132,7 @@ namespace Content.Server.Morgue.Components
|
|||
|
||||
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
|
||||
{
|
||||
var mind = victim.PlayerSession()?.ContentData()?.Mind;
|
||||
|
||||
if (mind != null)
|
||||
if (victim.TryGetComponent(out ActorComponent? actor) && actor.PlayerSession.ContentData()?.Mind is {} mind)
|
||||
{
|
||||
EntitySystem.Get<GameTicker>().OnGhostAttempt(mind, false);
|
||||
mind.OwnedEntity?.PopupMessage(Loc.GetString("crematorium-entity-storage-component-suicide-message"));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Content.Server.Act;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Server.Players;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Body.Components;
|
||||
|
|
@ -47,9 +48,7 @@ namespace Content.Server.Recycling.Components
|
|||
|
||||
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
|
||||
{
|
||||
var mind = victim.PlayerSession()?.ContentData()?.Mind;
|
||||
|
||||
if (mind != null)
|
||||
if (victim.TryGetComponent(out ActorComponent? actor) && actor.PlayerSession.ContentData()?.Mind is {} mind)
|
||||
{
|
||||
EntitySystem.Get<GameTicker>().OnGhostAttempt(mind, false);
|
||||
mind.OwnedEntity?.PopupMessage(Loc.GetString("recycler-component-suicide-message"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue