diff --git a/Content.Shared/Whitelist/EntityWhitelist.cs b/Content.Shared/Whitelist/EntityWhitelist.cs index adfe5e1f78..89a6f6ea53 100644 --- a/Content.Shared/Whitelist/EntityWhitelist.cs +++ b/Content.Shared/Whitelist/EntityWhitelist.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Content.Shared.Tag; +using Content.Shared.Wires; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Log; @@ -50,13 +51,16 @@ namespace Content.Shared.Whitelist _registrations = new List(); foreach (var name in Components) { - if (!compfact.TryGetRegistration(name, out var registration)) + var availability = compfact.GetComponentAvailability(name); + if (compfact.TryGetRegistration(name, out var registration) + && availability == ComponentAvailability.Available) { - Logger.Warning($"Invalid component name {name} passed to EntityWhitelist!"); - continue; + _registrations.Add(registration); + } + else if (availability == ComponentAvailability.Unknown) + { + Logger.Warning($"Unknown component name {name} passed to EntityWhitelist!"); } - - _registrations.Add(registration); } } @@ -75,7 +79,7 @@ namespace Content.Shared.Whitelist { foreach (var reg in _registrations) { - if (entity.TryGetComponent(reg.Type, out _)) + if (entity.HasComponent(reg.Type)) return true; } }