Skip to content

Commit

Permalink
Fixes bug with criminal records (space-wizards#24954)
Browse files Browse the repository at this point in the history
  • Loading branch information
AJCM-git committed Feb 5, 2024
1 parent 683591a commit a8c9af1
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ private void OnChangeStatus(Entity<CriminalRecordsConsoleComponent> ent, ref Cri
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
{
Expand All @@ -118,9 +124,7 @@ private void OnChangeStatus(Entity<CriminalRecordsConsoleComponent> ent, ref Cri
// 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);
}
Expand Down

0 comments on commit a8c9af1

Please sign in to comment.