Fix round end window (#17512)

This commit is contained in:
Leon Friedrich
2023-06-21 13:18:16 +12:00
committed by GitHub
parent 049281c4f6
commit 6485dbae01
3 changed files with 11 additions and 11 deletions

View File

@@ -307,12 +307,11 @@ namespace Content.Server.GameTicking
var allMinds = Get<MindTrackerSystem>().AllMinds; var allMinds = Get<MindTrackerSystem>().AllMinds;
foreach (var mind in allMinds) foreach (var mind in allMinds)
{ {
if (mind == null) // TODO don't list redundant observer roles?
continue; // 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 connected = false;
var observer = mind.AllRoles.Any(role => role is ObserverRole); var observer = mind.AllRoles.Any(role => role is ObserverRole);
// Continuing // Continuing

View File

@@ -39,19 +39,19 @@ namespace Content.Server.Mind
/// The session ID of the player owning this mind. /// The session ID of the player owning this mind.
/// </summary> /// </summary>
[ViewVariables, Access(typeof(MindSystem))] [ViewVariables, Access(typeof(MindSystem))]
public NetUserId? UserId { get; internal set; } public NetUserId? UserId { get; set; }
/// <summary> /// <summary>
/// The session ID of the original owner, if any. /// 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) /// May end up used for round-end information (as the owner may have abandoned Mind since)
/// </summary> /// </summary>
[ViewVariables] [ViewVariables, Access(typeof(MindSystem))]
public NetUserId? OriginalOwnerUserId { get; } public NetUserId? OriginalOwnerUserId { get; set; }
[ViewVariables] [ViewVariables]
public bool IsVisitingEntity => VisitingEntity != null; public bool IsVisitingEntity => VisitingEntity != null;
[ViewVariables] [ViewVariables, Access(typeof(MindSystem))]
public EntityUid? VisitingEntity { get; set; } public EntityUid? VisitingEntity { get; set; }
[ViewVariables] [ViewVariables]
@@ -78,8 +78,8 @@ namespace Content.Server.Mind
/// The entity currently owned by this mind. /// The entity currently owned by this mind.
/// Can be null. /// Can be null.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables, Access(typeof(MindSystem))]
public EntityUid? OwnedEntity { get; internal set; } public EntityUid? OwnedEntity { get; set; }
/// <summary> /// <summary>
/// An enumerable over all the roles this mind has. /// An enumerable over all the roles this mind has.

View File

@@ -629,6 +629,7 @@ public sealed class MindSystem : EntitySystem
_userMinds[userId.Value] = mind; _userMinds[userId.Value] = mind;
mind.UserId = userId; mind.UserId = userId;
mind.OriginalOwnerUserId ??= userId;
_playerManager.TryGetSessionById(userId.Value, out var ret); _playerManager.TryGetSessionById(userId.Value, out var ret);
mind.Session = ret; mind.Session = ret;