Adds ISuicideAct and support for Held Item and Environmental suicides (#1010)
This commit is contained in:
@@ -189,12 +189,13 @@ namespace Content.Server.BodySystem {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disconnects the given BodyPart reference, potentially dropping other BodyParts if they were hanging off it.
|
||||
/// Disconnects the given BodyPart reference, potentially dropping other BodyParts if they were hanging off it.
|
||||
/// </summary>
|
||||
public void DisconnectBodyPart(BodyPart part, bool dropEntity)
|
||||
/// <returns>Returns the dropped entity, or null if no part is dropped</returns>
|
||||
public IEntity DisconnectBodyPart(BodyPart part, bool dropEntity)
|
||||
{
|
||||
if (!_partDictionary.ContainsValue(part))
|
||||
return;
|
||||
return null;
|
||||
if (part != null)
|
||||
{
|
||||
string slotName = _partDictionary.FirstOrDefault(x => x.Value == part).Key;
|
||||
@@ -213,8 +214,10 @@ namespace Content.Server.BodySystem {
|
||||
{
|
||||
var partEntity = Owner.EntityManager.SpawnEntity("BaseDroppedBodyPart", Owner.Transform.GridPosition);
|
||||
partEntity.GetComponent<DroppedBodyPartComponent>().TransferBodyPartData(part);
|
||||
return partEntity;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user