* add types to explosion logs * make explosions logged by default * add cause parameter to IThresholdBehavior * add cause to ExplodeBehaviors * add cause to power cell explosions * remove useless log * add triggerer to triggers * add logs for damage from explosions * sneaky power cell update
23 lines
768 B
C#
23 lines
768 B
C#
using Robust.Shared.Containers;
|
|
|
|
namespace Content.Server.Destructible.Thresholds.Behaviors
|
|
{
|
|
/// <summary>
|
|
/// Drop all items from all containers
|
|
/// </summary>
|
|
[DataDefinition]
|
|
public sealed class EmptyAllContainersBehaviour : IThresholdBehavior
|
|
{
|
|
public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
|
|
{
|
|
if (!system.EntityManager.TryGetComponent<ContainerManagerComponent>(owner, out var containerManager))
|
|
return;
|
|
|
|
foreach (var container in containerManager.GetAllContainers())
|
|
{
|
|
container.EmptyContainer(true, system.EntityManager.GetComponent<TransformComponent>(owner).Coordinates);
|
|
}
|
|
}
|
|
}
|
|
}
|