From: Tayrtahn Date: Sun, 14 Apr 2024 02:19:42 +0000 (-0400) Subject: Fix cryostorage identifying unknown characters as captain (#26927) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9b97a2e05d5fe65b1d81aefcf37b69033c78f21f;p=space-station-14.git Fix cryostorage identifying unknown characters as captain (#26927) Fixed cryostorage getting captain's record for unknown jobs. Also localized Unknown job string. --- diff --git a/Content.Server/Bed/Cryostorage/CryostorageSystem.cs b/Content.Server/Bed/Cryostorage/CryostorageSystem.cs index bb2ab4099d..2e7f8c4235 100644 --- a/Content.Server/Bed/Cryostorage/CryostorageSystem.cs +++ b/Content.Server/Bed/Cryostorage/CryostorageSystem.cs @@ -225,13 +225,16 @@ public sealed class CryostorageSystem : SharedCryostorageSystem if (!TryComp(station, out var stationRecords)) return; - var key = new StationRecordKey(_stationRecords.GetRecordByName(station.Value, name) ?? default(uint), station.Value); - var jobName = "Unknown"; - - if (_stationRecords.TryGetRecord(key, out var entry, stationRecords)) - jobName = entry.JobTitle; + 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(key, out var entry, stationRecords)) + jobName = entry.JobTitle; - _stationRecords.RemoveRecord(key, stationRecords); + _stationRecords.RemoveRecord(key, stationRecords); + } _chatSystem.DispatchStationAnnouncement(station.Value, Loc.GetString( diff --git a/Resources/Locale/en-US/bed/cryostorage/cryogenic-storage.ftl b/Resources/Locale/en-US/bed/cryostorage/cryogenic-storage.ftl index 8de5f9019b..500a530562 100644 --- a/Resources/Locale/en-US/bed/cryostorage/cryogenic-storage.ftl +++ b/Resources/Locale/en-US/bed/cryostorage/cryogenic-storage.ftl @@ -1,5 +1,6 @@  ### Announcement +earlyleave-cryo-job-unknown = Unknown earlyleave-cryo-announcement = {$character} ({$job}) has entered cryogenic storage! earlyleave-cryo-sender = Station