From: Killerqu00 <47712032+Killerqu00@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:33:08 +0000 (+0100) Subject: [Bugfix] ContrabandSystem checks jobs correctly (#35228) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=239634269c2c3b179e33ebf5f59ef0e8c389852e;p=space-station-14.git [Bugfix] ContrabandSystem checks jobs correctly (#35228) * make it work lol * index protos only once --- 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"); }