]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
[Bugfix] ContrabandSystem checks jobs correctly (#35228)
authorKillerqu00 <47712032+Killerqu00@users.noreply.github.com>
Tue, 18 Feb 2025 11:33:08 +0000 (12:33 +0100)
committerGitHub <noreply@github.com>
Tue, 18 Feb 2025 11:33:08 +0000 (12:33 +0100)
* make it work lol

* index protos only once

Content.Shared/Contraband/ContrabandSystem.cs

index 7e5446da749b7f126aaa86f36f60be88873aae74..bfd7100289246a4036e3f9ee7fc4c70a78c30754 100644 (file)
@@ -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");
         }