]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixes bug with criminal records (#24954)
authorAJCM-git <60196617+AJCM-git@users.noreply.github.com>
Mon, 5 Feb 2024 00:12:07 +0000 (20:12 -0400)
committerGitHub <noreply@github.com>
Mon, 5 Feb 2024 00:12:07 +0000 (20:12 -0400)
Content.Server/CriminalRecords/Systems/CriminalRecordsConsoleSystem.cs

index 67ac1bf13c5d3372b5c7e0367d1ed0405649f6cc..f0a4f96152aa6d3187c387bae7359e7da97f3cf7 100644 (file)
@@ -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);
     }