Fix 3000 errors

This commit is contained in:
DrSmugleaf
2021-12-05 18:09:01 +01:00
parent 2bfec7ec62
commit 2a3b7d809d
569 changed files with 2979 additions and 3280 deletions

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Content.Shared.Administration;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -33,16 +32,17 @@ namespace Content.Server.Administration.Commands
foreach (var entity in entityManager.GetEntities())
{
if (checkPrototype && IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityPrototype != prototype || IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityPrototype == null)
var metaData = entityManager.GetComponent<MetaDataComponent>(entity);
if (checkPrototype && metaData.EntityPrototype != prototype || metaData.EntityPrototype == null)
{
continue;
}
var modified = false;
foreach (var component in IoCManager.Resolve<IEntityManager>().GetComponents(entity))
foreach (var component in entityManager.GetComponents(entity))
{
if (IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityPrototype.Components.ContainsKey(component.Name))
if (metaData.EntityPrototype.Components.ContainsKey(component.Name))
continue;
entityManager.RemoveComponent(entity, component);