Files
tbd-station-14/Content.Server/Destructible/Thresholds/Behaviors/GibBehavior.cs
Javier Guardia Fernández 42aaba9a5d Remove most IEntity usages from explosions (#5240)
* Remove most IEntity usages from Destructible and Explosions

* Perform a minute amount of cleanup

* Fix build
2021-11-09 21:24:35 +01:00

23 lines
638 B
C#

using Content.Shared.Body.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Destructible.Thresholds.Behaviors
{
[UsedImplicitly]
[DataDefinition]
public class GibBehavior : IThresholdBehavior
{
[DataField("recursive")] private bool _recursive = true;
public void Execute(EntityUid owner, DestructibleSystem system)
{
if (system.EntityManager.TryGetComponent(owner, out SharedBodyComponent? body))
{
body.Gib(_recursive);
}
}
}
}