[Bugfix] ContrabandSystem checks jobs correctly (#35228)
* make it work lol * index protos only once
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user