Fix 3000 errors
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Part;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -45,13 +44,13 @@ namespace Content.Server.Body.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.AttachedEntityUid == null)
|
||||
if (player.AttachedEntity == null)
|
||||
{
|
||||
shell.WriteLine("You don't have an entity to add a hand to.");
|
||||
return;
|
||||
}
|
||||
|
||||
entity = player.AttachedEntityUid.Value;
|
||||
entity = player.AttachedEntity.Value;
|
||||
hand = entityManager.SpawnEntity(DefaultHandPrototype, entityManager.GetComponent<TransformComponent>(entity).Coordinates);
|
||||
break;
|
||||
}
|
||||
@@ -76,13 +75,13 @@ namespace Content.Server.Body.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.AttachedEntityUid == null)
|
||||
if (player.AttachedEntity == null)
|
||||
{
|
||||
shell.WriteLine("You don't have an entity to add a hand to.");
|
||||
return;
|
||||
}
|
||||
|
||||
entity = player.AttachedEntityUid.Value;
|
||||
entity = player.AttachedEntity.Value;
|
||||
hand = entityManager.SpawnEntity(args[0], entityManager.GetComponent<TransformComponent>(entity).Coordinates);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Content.Server.Body.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity, out SharedBodyComponent? body))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity.Value, out SharedBodyComponent? body))
|
||||
{
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
var text = $"You have no body{(random.Prob(0.2f) ? " and you must scream." : ".")}";
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Server.Body.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity, out SharedBodyComponent? body))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity.Value, out SharedBodyComponent? body))
|
||||
{
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
var text = $"You have no body{(random.Prob(0.2f) ? " and you must scream." : ".")}";
|
||||
|
||||
Reference in New Issue
Block a user