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

@@ -20,7 +20,7 @@ namespace Content.Server.Body.Commands
var player = shell.Player as IPlayerSession;
var entityManager = IoCManager.Resolve<IEntityManager>();
IEntity entity;
EntityUid entity;
EntityUid partUid;
switch (args.Length)
@@ -44,7 +44,7 @@ namespace Content.Server.Body.Commands
return;
}
entity = player.AttachedEntity;
entity = player.AttachedEntity.Value;
break;
case 2:
@@ -60,44 +60,44 @@ namespace Content.Server.Body.Commands
return;
}
if (!entityManager.TryGetEntity(entityUid, out var tempEntity))
if (!entityManager.EntityExists(entityUid))
{
shell.WriteLine($"{entityUid} is not a valid entity.");
return;
}
entity = tempEntity;
entity = entityUid;
break;
default:
shell.WriteLine(Help);
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedBodyComponent? body))
if (!entityManager.TryGetComponent(entity, out SharedBodyComponent? body))
{
shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityName} with uid {entity} does not have a {nameof(SharedBodyComponent)} component.");
shell.WriteLine($"Entity {entityManager.GetComponent<MetaDataComponent>(entity).EntityName} with uid {entity} does not have a {nameof(SharedBodyComponent)} component.");
return;
}
if (!entityManager.TryGetEntity(partUid, out var partEntity))
if (!entityManager.EntityExists(partUid))
{
shell.WriteLine($"{partUid} is not a valid entity.");
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(partEntity, out SharedBodyPartComponent? part))
if (!entityManager.TryGetComponent(partUid, out SharedBodyPartComponent? part))
{
shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(partEntity).EntityName} with uid {args[0]} does not have a {nameof(SharedBodyPartComponent)} component.");
shell.WriteLine($"Entity {entityManager.GetComponent<MetaDataComponent>(partUid).EntityName} with uid {args[0]} does not have a {nameof(SharedBodyPartComponent)} component.");
return;
}
if (body.HasPart(part))
{
shell.WriteLine($"Body part {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(partEntity).EntityName} with uid {partEntity} is already attached to entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityName} with uid {entity}");
shell.WriteLine($"Body part {entityManager.GetComponent<MetaDataComponent>(partUid).EntityName} with uid {partUid} is already attached to entity {entityManager.GetComponent<MetaDataComponent>(entity).EntityName} with uid {entity}");
return;
}
body.SetPart($"AttachBodyPartVerb-{partEntity}", part);
body.SetPart($"AttachBodyPartVerb-{partUid}", part);
}
}
}