Entity whitelist/blacklist for traits (#12348)

This commit is contained in:
Rane
2022-11-03 21:37:17 -04:00
committed by GitHub
parent 74b63e83fd
commit 084b482cfe
4 changed files with 26 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
using Content.Server.GameTicking;
using Content.Shared.Traits;
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager;
@@ -28,6 +29,12 @@ public sealed class TraitSystem : EntitySystem
return;
}
if (traitPrototype.Whitelist != null && !traitPrototype.Whitelist.IsValid(args.Mob))
continue;
if (traitPrototype.Blacklist != null && traitPrototype.Blacklist.IsValid(args.Mob))
continue;
// Add all components required by the prototype
foreach (var entry in traitPrototype.Components.Values)
{