Skip to content

Commit

Permalink
Update TraitSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Aug 21, 2024
1 parent 1af6c52 commit 2d6ad3b
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Content.Server/Traits/TraitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/// <summary>
/// Adds a single Trait Prototype to an Entity.
/// </summary>
/// <param name="uid"></param>
/// <param name="traitPrototype"></param>
public void AddTrait(EntityUid uid, TraitPrototype traitPrototype)
{
AddTraitComponents(uid, traitPrototype);
AddTraitActions(uid, traitPrototype);
AddTraitPsionics(uid, traitPrototype);
}

/// <summary>
/// Adds all Components included with a Trait.
/// </summary>
/// <param name="uid"></param>
/// <param name="traitPrototype"></param>
private void AddTraitComponents(EntityUid uid, TraitPrototype traitPrototype)
public void AddTraitComponents(EntityUid uid, TraitPrototype traitPrototype)
{
if (traitPrototype.Components is null)
return;
Expand All @@ -82,7 +92,7 @@ private void AddTraitComponents(EntityUid uid, TraitPrototype traitPrototype)
/// <param name="uid"></param>
/// <param name="proto"></param>
/// <param name="psionic"></param>
private void AddTraitActions(EntityUid uid, TraitPrototype traitPrototype)
public void AddTraitActions(EntityUid uid, TraitPrototype traitPrototype)
{
if (traitPrototype.Actions is null)
return;
Expand All @@ -103,7 +113,7 @@ private void AddTraitActions(EntityUid uid, TraitPrototype traitPrototype)
/// </summary>
/// <param name="uid"></param>
/// <param name="traitPrototype"></param>
private void AddTraitPsionics(EntityUid uid, TraitPrototype traitPrototype)
public void AddTraitPsionics(EntityUid uid, TraitPrototype traitPrototype)
{
if (traitPrototype.PsionicPowers is null)
return;
Expand Down

0 comments on commit 2d6ad3b

Please sign in to comment.