From: AJCM-git <60196617+AJCM-git@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:12:07 +0000 (-0400) Subject: Fixes bug with criminal records (#24954) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a8c9af1227714aa33efeebb88aa3c9b38067d834;p=space-station-14.git Fixes bug with criminal records (#24954) --- diff --git a/Content.Server/CriminalRecords/Systems/CriminalRecordsConsoleSystem.cs b/Content.Server/CriminalRecords/Systems/CriminalRecordsConsoleSystem.cs index 67ac1bf13c..f0a4f96152 100644 --- a/Content.Server/CriminalRecords/Systems/CriminalRecordsConsoleSystem.cs +++ b/Content.Server/CriminalRecords/Systems/CriminalRecordsConsoleSystem.cs @@ -104,6 +104,12 @@ public sealed class CriminalRecordsConsoleSystem : EntitySystem if (_idCard.TryFindIdCard(mob.Value, out var id) && id.Comp.FullName is {} fullName) officer = fullName; + (string, object)[] args; + if (reason != null) + args = new (string, object)[] { ("name", name), ("officer", officer), ("reason", reason) }; + else + args = new (string, object)[] { ("name", name), ("officer", officer) }; + // figure out which radio message to send depending on transition var statusString = (oldStatus, msg.Status) switch { @@ -118,9 +124,7 @@ public sealed class CriminalRecordsConsoleSystem : EntitySystem // this is impossible _ => "not-wanted" }; - var message = Loc.GetString($"criminal-records-console-{statusString}", ("name", name), ("officer", officer), - reason != null ? ("reason", reason) : default!); - _radio.SendRadioMessage(ent, message, ent.Comp.SecurityChannel, ent); + _radio.SendRadioMessage(ent, Loc.GetString($"criminal-records-console-{statusString}", args), ent.Comp.SecurityChannel, ent); UpdateUserInterface(ent); }