From 2d6ad3b682a8d66a39eb67dbe44a3864f63d4d72 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Wed, 21 Aug 2024 05:13:25 -0400 Subject: [PATCH] Update TraitSystem.cs --- Content.Server/Traits/TraitSystem.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Content.Server/Traits/TraitSystem.cs b/Content.Server/Traits/TraitSystem.cs index 925c80acc3b..7da7b9588d1 100644 --- a/Content.Server/Traits/TraitSystem.cs +++ b/Content.Server/Traits/TraitSystem.cs @@ -49,18 +49,28 @@ private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent args) out _)) continue; - AddTraitComponents(args.Mob, traitPrototype); - AddTraitActions(args.Mob, traitPrototype); - AddTraitPsionics(args.Mob, traitPrototype); + AddTrait(args.Mob, traitPrototype); } } + /// + /// Adds a single Trait Prototype to an Entity. + /// + /// + /// + public void AddTrait(EntityUid uid, TraitPrototype traitPrototype) + { + AddTraitComponents(uid, traitPrototype); + AddTraitActions(uid, traitPrototype); + AddTraitPsionics(uid, traitPrototype); + } + /// /// Adds all Components included with a Trait. /// /// /// - private void AddTraitComponents(EntityUid uid, TraitPrototype traitPrototype) + public void AddTraitComponents(EntityUid uid, TraitPrototype traitPrototype) { if (traitPrototype.Components is null) return; @@ -82,7 +92,7 @@ private void AddTraitComponents(EntityUid uid, TraitPrototype traitPrototype) /// /// /// - private void AddTraitActions(EntityUid uid, TraitPrototype traitPrototype) + public void AddTraitActions(EntityUid uid, TraitPrototype traitPrototype) { if (traitPrototype.Actions is null) return; @@ -103,7 +113,7 @@ private void AddTraitActions(EntityUid uid, TraitPrototype traitPrototype) /// /// /// - private void AddTraitPsionics(EntityUid uid, TraitPrototype traitPrototype) + public void AddTraitPsionics(EntityUid uid, TraitPrototype traitPrototype) { if (traitPrototype.PsionicPowers is null) return;