- fix: Show true name in station records. (#34)
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Server.Humanoid;
|
||||
using Content.Server.IdentityManagement;
|
||||
using Content.Server.PDA;
|
||||
using Content.Server.Roles;
|
||||
using Content.Server.StationRecords.Systems;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Inventory;
|
||||
@@ -10,6 +11,7 @@ using Content.Shared.Mind.Components;
|
||||
using Content.Shared.NukeOps;
|
||||
using Content.Shared.PDA;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Shared.StationRecords;
|
||||
|
||||
namespace Content.Server._White.Other.RandomHumanSystem;
|
||||
|
||||
@@ -21,7 +23,7 @@ public sealed class RandomHumanSystem : EntitySystem
|
||||
[Dependency] private readonly IdCardSystem _card = default!;
|
||||
[Dependency] private readonly PdaSystem _pda = default!;
|
||||
[Dependency] private readonly IdentitySystem _identity = default!;
|
||||
[Dependency] private readonly RoleSystem _roles = default!;
|
||||
[Dependency] private readonly StationRecordsSystem _records = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -58,6 +60,21 @@ public sealed class RandomHumanSystem : EntitySystem
|
||||
_card.TryChangeFullName(cardId, newProfile.Name, card);
|
||||
_pda.SetOwner(idUid.Value, pdaComponent, newProfile.Name);
|
||||
|
||||
if (EntityManager.TryGetComponent(cardId, out StationRecordKeyStorageComponent? keyStorage)
|
||||
&& keyStorage.Key is { } key)
|
||||
{
|
||||
if (_records.TryGetRecord<GeneralStationRecord>(key, out var generalRecord))
|
||||
{
|
||||
generalRecord.Name = newProfile.Name;
|
||||
generalRecord.Age = newProfile.Age;
|
||||
generalRecord.Gender = newProfile.Gender;
|
||||
generalRecord.Species = newProfile.Species;
|
||||
generalRecord.Profile = newProfile;
|
||||
}
|
||||
|
||||
_records.Synchronize(key);
|
||||
}
|
||||
|
||||
_identity.QueueIdentityUpdate(uid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user