Remember the first entity a Mind controls for the endround screen (#16950)
This commit is contained in:
@@ -343,7 +343,7 @@ namespace Content.Server.GameTicking
|
||||
PlayerOOCName = contentPlayerData?.Name ?? "(IMPOSSIBLE: REGISTERED MIND WITH NO OWNER)",
|
||||
// Character name takes precedence over current entity name
|
||||
PlayerICName = playerIcName,
|
||||
PlayerEntityUid = mind.OwnedEntity,
|
||||
PlayerEntityUid = mind.OriginalOwnedEntity,
|
||||
Role = antag
|
||||
? mind.AllRoles.First(role => role.Antagonist).Name
|
||||
: mind.AllRoles.FirstOrDefault()?.Name ?? Loc.GetString("game-ticker-unknown-role"),
|
||||
|
||||
@@ -48,6 +48,12 @@ namespace Content.Server.Mind
|
||||
[ViewVariables, Access(typeof(MindSystem))]
|
||||
public NetUserId? OriginalOwnerUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Entity UID for the first entity that this mind controlled. Used for round end.
|
||||
/// Might be relevant if the player has ghosted since.
|
||||
/// </summary>
|
||||
[ViewVariables] public EntityUid? OriginalOwnedEntity;
|
||||
|
||||
[ViewVariables]
|
||||
public bool IsVisitingEntity => VisitingEntity != null;
|
||||
|
||||
|
||||
@@ -413,8 +413,10 @@ public sealed class MindSystem : EntitySystem
|
||||
InternalEjectMind(oldEntity.Value, oldComp);
|
||||
|
||||
SetOwnedEntity(mind, entity, component);
|
||||
if (mind.OwnedComponent != null)
|
||||
if (mind.OwnedComponent != null){
|
||||
InternalAssignMind(mind.OwnedEntity!.Value, mind, mind.OwnedComponent);
|
||||
mind.OriginalOwnedEntity ??= mind.OwnedEntity;
|
||||
}
|
||||
|
||||
// Don't do the full deletion cleanup if we're transferring to our VisitingEntity
|
||||
if (alreadyAttached)
|
||||
|
||||
Reference in New Issue
Block a user