Fix cryostorage identifying unknown characters as captain (#26927)

Fixed cryostorage getting captain's record for unknown jobs.
Also localized Unknown job string.
This commit is contained in:
Tayrtahn
2024-04-13 22:19:42 -04:00
committed by GitHub
parent 1f4a01aa38
commit 9b97a2e05d
2 changed files with 10 additions and 6 deletions

View File

@@ -225,13 +225,16 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
if (!TryComp<StationRecordsComponent>(station, out var stationRecords))
return;
var key = new StationRecordKey(_stationRecords.GetRecordByName(station.Value, name) ?? default(uint), station.Value);
var jobName = "Unknown";
var jobName = Loc.GetString("earlyleave-cryo-job-unknown");
var recordId = _stationRecords.GetRecordByName(station.Value, name);
if (recordId != null)
{
var key = new StationRecordKey(recordId.Value, station.Value);
if (_stationRecords.TryGetRecord<GeneralStationRecord>(key, out var entry, stationRecords))
jobName = entry.JobTitle;
if (_stationRecords.TryGetRecord<GeneralStationRecord>(key, out var entry, stationRecords))
jobName = entry.JobTitle;
_stationRecords.RemoveRecord(key, stationRecords);
_stationRecords.RemoveRecord(key, stationRecords);
}
_chatSystem.DispatchStationAnnouncement(station.Value,
Loc.GetString(

View File

@@ -1,5 +1,6 @@
### Announcement
earlyleave-cryo-job-unknown = Unknown
earlyleave-cryo-announcement = {$character} ({$job}) has entered cryogenic storage!
earlyleave-cryo-sender = Station