Fix removehand command when you have no hands (#2685)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
DrSmugleaf
2020-12-04 13:17:40 +01:00
committed by GitHub
parent af28de36ee
commit 1eaad7e5d7
2 changed files with 8 additions and 11 deletions

View File

@@ -42,14 +42,14 @@ namespace Content.Server.Commands.Body
return;
}
var hand = body.Parts.FirstOrDefault(x => x.Value.PartType == BodyPartType.Hand);
if (hand.Value.Equals(default))
var (_, hand) = body.Parts.FirstOrDefault(x => x.Value.PartType == BodyPartType.Hand);
if (hand == null)
{
shell.SendText(player, "You have no hands.");
}
else
{
body.RemovePart(hand.Value);
body.RemovePart(hand);
}
}
}