Remember the first entity a Mind controls for the endround screen (#16950)
This commit is contained in:
@@ -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