From 239634269c2c3b179e33ebf5f59ef0e8c389852e Mon Sep 17 00:00:00 2001 From: Killerqu00 <47712032+Killerqu00@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:33:08 +0100 Subject: [PATCH] [Bugfix] ContrabandSystem checks jobs correctly (#35228) * make it work lol * index protos only once --- Content.Shared/Contraband/ContrabandSystem.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Contraband/ContrabandSystem.cs b/Content.Shared/Contraband/ContrabandSystem.cs index 7e5446da74..bfd7100289 100644 --- a/Content.Shared/Contraband/ContrabandSystem.cs +++ b/Content.Shared/Contraband/ContrabandSystem.cs @@ -56,7 +56,8 @@ public sealed class ContrabandSystem : EntitySystem // one, the actual informative 'this is restricted' // then, the 'you can/shouldn't carry this around' based on the ID the user is wearing var localizedDepartments = component.AllowedDepartments.Select(p => Loc.GetString("contraband-department-plural", ("department", Loc.GetString(_proto.Index(p).Name)))); - var localizedJobs = component.AllowedJobs.Select(p => Loc.GetString("contraband-job-plural", ("job", _proto.Index(p).LocalizedName))); + var jobs = component.AllowedJobs.Select(p => _proto.Index(p).LocalizedName).ToArray(); + var localizedJobs = jobs.Select(p => Loc.GetString("contraband-job-plural", ("job", p))); var severity = _proto.Index(component.Severity); String departmentExamineMessage; if (severity.ShowDepartmentsAndJobs) @@ -86,7 +87,7 @@ public sealed class ContrabandSystem : EntitySystem String carryingMessage; // either its fully restricted, you have no departments, or your departments dont intersect with the restricted departments if (departments.Intersect(component.AllowedDepartments).Any() - || localizedJobs.Contains(jobId)) + || jobs.Contains(jobId)) { carryingMessage = Loc.GetString("contraband-examine-text-in-the-clear"); } -- 2.51.2