diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 6b85f718e0..59ab69e3a0 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -307,12 +307,11 @@ namespace Content.Server.GameTicking var allMinds = Get().AllMinds; foreach (var mind in allMinds) { - if (mind == null) - continue; + // TODO don't list redundant observer roles? + // I.e., if a player was an observer ghost, then a hamster ghost role, maybe just list hamster and not + // the observer role? + var userId = mind.UserId ?? mind.OriginalOwnerUserId; - // Some basics assuming things fail - var userId = mind.OriginalOwnerUserId; - var playerOOCName = userId.ToString(); var connected = false; var observer = mind.AllRoles.Any(role => role is ObserverRole); // Continuing diff --git a/Content.Server/Mind/Mind.cs b/Content.Server/Mind/Mind.cs index b1a6e228e0..e219624ac7 100644 --- a/Content.Server/Mind/Mind.cs +++ b/Content.Server/Mind/Mind.cs @@ -39,19 +39,19 @@ namespace Content.Server.Mind /// The session ID of the player owning this mind. /// [ViewVariables, Access(typeof(MindSystem))] - public NetUserId? UserId { get; internal set; } + public NetUserId? UserId { get; set; } /// /// The session ID of the original owner, if any. /// May end up used for round-end information (as the owner may have abandoned Mind since) /// - [ViewVariables] - public NetUserId? OriginalOwnerUserId { get; } + [ViewVariables, Access(typeof(MindSystem))] + public NetUserId? OriginalOwnerUserId { get; set; } [ViewVariables] public bool IsVisitingEntity => VisitingEntity != null; - [ViewVariables] + [ViewVariables, Access(typeof(MindSystem))] public EntityUid? VisitingEntity { get; set; } [ViewVariables] @@ -78,8 +78,8 @@ namespace Content.Server.Mind /// The entity currently owned by this mind. /// Can be null. /// - [ViewVariables] - public EntityUid? OwnedEntity { get; internal set; } + [ViewVariables, Access(typeof(MindSystem))] + public EntityUid? OwnedEntity { get; set; } /// /// An enumerable over all the roles this mind has. diff --git a/Content.Server/Mind/MindSystem.cs b/Content.Server/Mind/MindSystem.cs index c6b8a65af0..18420d3702 100644 --- a/Content.Server/Mind/MindSystem.cs +++ b/Content.Server/Mind/MindSystem.cs @@ -629,6 +629,7 @@ public sealed class MindSystem : EntitySystem _userMinds[userId.Value] = mind; mind.UserId = userId; + mind.OriginalOwnerUserId ??= userId; _playerManager.TryGetSessionById(userId.Value, out var ret); mind.Session = ret;