From: Tayrtahn Date: Mon, 3 Mar 2025 01:03:16 +0000 (-0500) Subject: Add GetBaseName method to NameModifierSystem (#35633) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7e7d12d437f0ae32459ffc36bd0376fff6334945;p=space-station-14.git Add GetBaseName method to NameModifierSystem (#35633) * Add GetBaseName method to NameModifierSystem * Use Name --- diff --git a/Content.Shared/NameModifier/EntitySystems/NameModifierSystem.cs b/Content.Shared/NameModifier/EntitySystems/NameModifierSystem.cs index 2e7c8054b3..33f6efbed5 100644 --- a/Content.Shared/NameModifier/EntitySystems/NameModifierSystem.cs +++ b/Content.Shared/NameModifier/EntitySystems/NameModifierSystem.cs @@ -32,6 +32,18 @@ public sealed class NameModifierSystem : EntitySystem Dirty(entity); } + /// + /// Returns the base name of the entity, without any modifiers applied. + /// If the entity doesn't have a , + /// this returns the entity's metadata name. + /// + public string GetBaseName(Entity entity) + { + if (Resolve(entity, ref entity.Comp, logMissing: false)) + return entity.Comp.BaseName; + return Name(entity); + } + /// /// Raises a to gather modifiers and /// updates the entity's name to its base name with modifiers applied.