diff --git a/Content.Server/Mind/Commands/RenameCommand.cs b/Content.Server/Mind/Commands/RenameCommand.cs index b256e1bda8..2986f578e1 100644 --- a/Content.Server/Mind/Commands/RenameCommand.cs +++ b/Content.Server/Mind/Commands/RenameCommand.cs @@ -4,9 +4,11 @@ using Content.Server.Administration.Systems; using Content.Server.Cloning; using Content.Server.Mind.Components; using Content.Server.PDA; +using Content.Server.StationRecords; using Content.Shared.Access.Components; using Content.Shared.Administration; using Content.Shared.PDA; +using Content.Shared.StationRecords; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Console; @@ -57,7 +59,25 @@ public sealed class RenameCommand : IConsoleCommand if (entSysMan.TryGetEntitySystem(out var idCardSystem)) { if (idCardSystem.TryFindIdCard(entityUid, out var idCard)) + { idCardSystem.TryChangeFullName(idCard.Owner, name, idCard); + + // Records + // This is done here because ID cards are linked to station records + if (entSysMan.TryGetEntitySystem(out var recordsSystem) + && entMan.TryGetComponent(idCard.Owner, out StationRecordKeyStorageComponent? keyStorage) + && keyStorage.Key != null) + { + if (recordsSystem.TryGetRecord(keyStorage.Key.Value.OriginStation, + keyStorage.Key.Value, + out var generalRecord)) + { + generalRecord.Name = name; + } + + recordsSystem.Synchronize(keyStorage.Key.Value.OriginStation); + } + } } // PDAs