Add a command and verb to attach a body part to yourself (#2372)
* Add attachbodypart command * Make the slot name depend on the verb instead of the command
This commit is contained in:
@@ -56,6 +56,8 @@ namespace Content.Shared.GameObjects.Components.Body
|
||||
|
||||
bool HasPart(string slot);
|
||||
|
||||
bool HasPart(IBodyPart part);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the given <see cref="IBodyPart"/> reference, potentially
|
||||
/// dropping other <see cref="IBodyPart">BodyParts</see> if they
|
||||
|
||||
@@ -286,7 +286,8 @@ namespace Content.Shared.GameObjects.Components.Body.Part
|
||||
|
||||
private void AddedToBody(IBody body)
|
||||
{
|
||||
Owner.Transform.AttachParent(Body!.Owner);
|
||||
Owner.Transform.LocalRotation = 0;
|
||||
Owner.Transform.AttachParent(body.Owner);
|
||||
OnAddedToBody(body);
|
||||
|
||||
foreach (var mechanism in _mechanisms)
|
||||
|
||||
@@ -145,6 +145,13 @@ namespace Content.Shared.GameObjects.Components.Body
|
||||
return _parts.ContainsKey(slot);
|
||||
}
|
||||
|
||||
public bool HasPart(IBodyPart part)
|
||||
{
|
||||
DebugTools.AssertNotNull(part);
|
||||
|
||||
return _parts.ContainsValue(part);
|
||||
}
|
||||
|
||||
public void RemovePart(IBodyPart part)
|
||||
{
|
||||
DebugTools.AssertNotNull(part);
|
||||
|
||||
Reference in New Issue
Block a user