remove Session from MindComponent (#34753)

* yummy

* fix tests
This commit is contained in:
Milon
2025-04-19 00:23:01 +02:00
committed by GitHub
parent ba6d8f5376
commit 3fc9bcbbbe
25 changed files with 149 additions and 134 deletions

View File

@@ -8,6 +8,7 @@ using Content.Shared.Mind;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.Player;
namespace Content.Server.Administration.Commands;
@@ -15,7 +16,7 @@ namespace Content.Server.Administration.Commands;
public sealed class AGhostCommand : LocalizedCommands
{
[Dependency] private readonly IEntityManager _entities = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
public override string Command => "aghost";
public override string Help => "aghost";
@@ -104,8 +105,8 @@ public sealed class AGhostCommand : LocalizedCommands
// TODO: Remove duplication between all this and "GamePreset.OnGhostAttempt()"...
if (!string.IsNullOrWhiteSpace(mind.CharacterName))
metaDataSystem.SetEntityName(ghost, mind.CharacterName);
else if (!string.IsNullOrWhiteSpace(mind.Session?.Name))
metaDataSystem.SetEntityName(ghost, mind.Session.Name);
else if (!string.IsNullOrWhiteSpace(player.Name))
metaDataSystem.SetEntityName(ghost, player.Name);
mindSystem.Visit(mindId, ghost, mind);
}