diff --git a/Content.Server/GameObjects/Components/Access/IdCardComponent.cs b/Content.Server/GameObjects/Components/Access/IdCardComponent.cs index 2bd23e5cdd..fca076ed8b 100644 --- a/Content.Server/GameObjects/Components/Access/IdCardComponent.cs +++ b/Content.Server/GameObjects/Components/Access/IdCardComponent.cs @@ -67,7 +67,7 @@ namespace Content.Server.GameObjects.Components.Access public override void Initialize() { base.Initialize(); - _ownerOriginalName = Owner.Name; + _ownerOriginalName ??= Owner.Name; UpdateEntityName(); } @@ -77,6 +77,7 @@ namespace Content.Server.GameObjects.Components.Access serializer.DataField(ref _fullName, "fullName", string.Empty); serializer.DataField(ref _jobTitle, "jobTitle", string.Empty); + serializer.DataField(ref _ownerOriginalName, "originalOwnerName", null); } } } diff --git a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs index c5ed36ede8..efd7c1da4b 100644 --- a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs +++ b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs @@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.Components.PDA [RegisterComponent] [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(IAccess))] - public class PDAComponent : SharedPDAComponent, IInteractUsing, IActivate, IUse, IAccess + public class PDAComponent : SharedPDAComponent, IInteractUsing, IActivate, IUse, IAccess, IMapInit { [Dependency] private readonly IPDAUplinkManager _uplinkManager = default!; [Dependency] private readonly IEntityManager _entityManager = default!; @@ -86,6 +86,11 @@ namespace Content.Server.GameObjects.Components.PDA UserInterface.OnReceiveMessage += UserInterfaceOnReceiveMessage; } + UpdatePDAAppearance(); + } + + public void MapInit() + { if (!string.IsNullOrEmpty(_startingIdCard)) { var idCard = _entityManager.SpawnEntity(_startingIdCard, Owner.Transform.Coordinates); @@ -99,8 +104,6 @@ namespace Content.Server.GameObjects.Components.PDA var pen = _entityManager.SpawnEntity(_startingPen, Owner.Transform.Coordinates); _penSlot.Insert(pen); } - - UpdatePDAAppearance(); } private void UserInterfaceOnReceiveMessage(ServerBoundUserInterfaceMessage message) @@ -434,6 +437,7 @@ namespace Content.Server.GameObjects.Components.PDA } ISet IAccess.Tags => _accessSet; + bool IAccess.IsReadOnly => true; void IAccess.SetTags(IEnumerable newTags)