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

@@ -15,6 +15,7 @@ namespace Content.Server.Administration.Commands
var id = args.Length == 0 ? null : string.Join(" ", args);
var entityManager = IoCManager.Resolve<IEntityManager>();
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var fac = IoCManager.Resolve<IComponentFactory>();
EntityPrototype? prototype = null;
var checkPrototype = !string.IsNullOrEmpty(id);
@@ -40,7 +41,7 @@ namespace Content.Server.Administration.Commands
foreach (var component in entityManager.GetComponents(entity))
{
if (metaData.EntityPrototype.Components.ContainsKey(component.Name))
if (metaData.EntityPrototype.Components.ContainsKey(fac.GetComponentName(component.GetType())))
continue;
entityManager.RemoveComponent(entity, component);