Inline UID

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:53:09 +01:00
parent 2654775bf0
commit 5cd42c9ad6
803 changed files with 3613 additions and 3577 deletions

View File

@@ -52,7 +52,7 @@ namespace Content.Server.Body.Commands
}
entity = player.AttachedEntityUid.Value;
hand = entityManager.SpawnEntity(DefaultHandPrototype, entityManager.GetComponent<TransformComponent>(entity).Coordinates).Uid;
hand = entityManager.SpawnEntity(DefaultHandPrototype, entityManager.GetComponent<TransformComponent>(entity).Coordinates);
break;
}
case 1:
@@ -66,7 +66,7 @@ namespace Content.Server.Body.Commands
}
entity = uid;
hand = entityManager.SpawnEntity(DefaultHandPrototype, entityManager.GetComponent<TransformComponent>(entity).Coordinates).Uid;
hand = entityManager.SpawnEntity(DefaultHandPrototype, entityManager.GetComponent<TransformComponent>(entity).Coordinates);
}
else
{
@@ -83,7 +83,7 @@ namespace Content.Server.Body.Commands
}
entity = player.AttachedEntityUid.Value;
hand = entityManager.SpawnEntity(args[0], entityManager.GetComponent<TransformComponent>(entity).Coordinates).Uid;
hand = entityManager.SpawnEntity(args[0], entityManager.GetComponent<TransformComponent>(entity).Coordinates);
}
break;
@@ -110,7 +110,7 @@ namespace Content.Server.Body.Commands
return;
}
hand = entityManager.SpawnEntity(args[1], entityManager.GetComponent<TransformComponent>(entity).Coordinates).Uid;
hand = entityManager.SpawnEntity(args[1], entityManager.GetComponent<TransformComponent>(entity).Coordinates);
break;
}

View File

@@ -73,9 +73,9 @@ namespace Content.Server.Body.Commands
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out SharedBodyComponent? body))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out SharedBodyComponent? body))
{
shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName} with uid {entity.Uid} does not have a {nameof(SharedBodyComponent)} component.");
shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityName} with uid {entity} does not have a {nameof(SharedBodyComponent)} component.");
return;
}
@@ -85,19 +85,19 @@ namespace Content.Server.Body.Commands
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(partEntity.Uid, out SharedBodyPartComponent? part))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(partEntity, out SharedBodyPartComponent? part))
{
shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(partEntity.Uid).EntityName} with uid {args[0]} does not have a {nameof(SharedBodyPartComponent)} component.");
shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(partEntity).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.Uid).EntityName} with uid {partEntity.Uid} is already attached to entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName} with uid {entity.Uid}");
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}");
return;
}
body.SetPart($"AttachBodyPartVerb-{partEntity.Uid}", part);
body.SetPart($"AttachBodyPartVerb-{partEntity}", part);
}
}
}

View File

@@ -37,7 +37,7 @@ namespace Content.Server.Body.Commands
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity.Uid, out SharedBodyComponent? body))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity, out SharedBodyComponent? body))
{
var random = IoCManager.Resolve<IRobustRandom>();
var text = $"You have no body{(random.Prob(0.2f) ? " and you must scream." : ".")}";

View File

@@ -33,7 +33,7 @@ namespace Content.Server.Body.Commands
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity.Uid, out SharedBodyComponent? body))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity, out SharedBodyComponent? body))
{
var random = IoCManager.Resolve<IRobustRandom>();
var text = $"You have no body{(random.Prob(0.2f) ? " and you must scream." : ".")}";