criminal records revival (#22510)

This commit is contained in:
deltanedas
2024-02-04 23:29:35 +00:00
committed by GitHub
parent c856dd7506
commit 683591ab04
34 changed files with 1564 additions and 339 deletions

View File

@@ -68,18 +68,14 @@ public sealed class RenameCommand : IConsoleCommand
// This is done here because ID cards are linked to station records
if (_entManager.TrySystem<StationRecordsSystem>(out var recordsSystem)
&& _entManager.TryGetComponent(idCard, out StationRecordKeyStorageComponent? keyStorage)
&& keyStorage.Key != null)
&& keyStorage.Key is {} key)
{
var origin = keyStorage.Key.Value.OriginStation;
if (recordsSystem.TryGetRecord<GeneralStationRecord>(origin,
keyStorage.Key.Value,
out var generalRecord))
if (recordsSystem.TryGetRecord<GeneralStationRecord>(key, out var generalRecord))
{
generalRecord.Name = name;
}
recordsSystem.Synchronize(origin);
recordsSystem.Synchronize(key);
}
}
}