Remove last component.Name calls (#13593)

This commit is contained in:
metalgearsloth
2023-01-19 13:57:18 +11:00
committed by GitHub
parent c6d3e4f3bd
commit 1b0e50ae19
11 changed files with 19 additions and 14 deletions

View File

@@ -37,6 +37,8 @@ namespace Content.Server.Body.Commands
}
var entityManager = IoCManager.Resolve<IEntityManager>();
var fac = IoCManager.Resolve<IComponentFactory>();
if (!entityManager.TryGetComponent(attached, out BodyComponent? body))
{
var random = IoCManager.Resolve<IRobustRandom>();
@@ -51,7 +53,7 @@ namespace Content.Server.Body.Commands
foreach (var organ in bodySystem.GetBodyOrgans(body.Owner, body))
{
if (organ.Component.Name.ToLowerInvariant() == mechanismName)
if (fac.GetComponentName(organ.Component.GetType()).ToLowerInvariant() == mechanismName)
{
bodySystem.DeleteOrgan(organ.Id, organ.Component);
shell.WriteLine($"Mechanism with name {mechanismName} has been destroyed.");