Goes in-game now
This commit is contained in:
@@ -44,13 +44,13 @@ namespace Content.Server.Body.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.AttachedEntity == default)
|
||||
if (player.AttachedEntity == null)
|
||||
{
|
||||
shell.WriteLine("You don't have an entity to add a hand to.");
|
||||
return;
|
||||
}
|
||||
|
||||
entity = player.AttachedEntity;
|
||||
entity = player.AttachedEntity.Value;
|
||||
hand = entityManager.SpawnEntity(DefaultHandPrototype, entityManager.GetComponent<TransformComponent>(entity).Coordinates);
|
||||
break;
|
||||
}
|
||||
@@ -75,13 +75,13 @@ namespace Content.Server.Body.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.AttachedEntity == default)
|
||||
if (player.AttachedEntity == null)
|
||||
{
|
||||
shell.WriteLine("You don't have an entity to add a hand to.");
|
||||
return;
|
||||
}
|
||||
|
||||
entity = player.AttachedEntity;
|
||||
entity = player.AttachedEntity.Value;
|
||||
hand = entityManager.SpawnEntity(args[0], entityManager.GetComponent<TransformComponent>(entity).Coordinates);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Content.Server.Body.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
entity = player.AttachedEntity;
|
||||
entity = player.AttachedEntity.Value;
|
||||
|
||||
break;
|
||||
case 2:
|
||||
|
||||
@@ -31,13 +31,13 @@ namespace Content.Server.Body.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.AttachedEntity == default)
|
||||
if (player.AttachedEntity is not {} attached)
|
||||
{
|
||||
shell.WriteLine("You have no entity.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(player.AttachedEntity, out SharedBodyComponent? body))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(attached, 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