Don't add trait comps if present (#16424)

This commit is contained in:
metalgearsloth
2023-05-14 21:18:18 +10:00
committed by GitHub
parent 630ac19309
commit d254a7d2cb

View File

@@ -40,6 +40,9 @@ public sealed class TraitSystem : EntitySystem
// Add all components required by the prototype
foreach (var entry in traitPrototype.Components.Values)
{
if (HasComp(args.Mob, entry.Component.GetType()))
continue;
var comp = (Component) _serializationManager.CreateCopy(entry.Component, notNullableOverride: true);
comp.Owner = args.Mob;
EntityManager.AddComponent(args.Mob, comp);