* Remove most IEntity usages from Destructible and Explosions * Perform a minute amount of cleanup * Fix build
24 lines
768 B
C#
24 lines
768 B
C#
using System;
|
|
using Content.Server.Construction.Components;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
|
|
|
namespace Content.Server.Destructible.Thresholds.Behaviors
|
|
{
|
|
[Serializable]
|
|
[DataDefinition]
|
|
public class ChangeConstructionNodeBehavior : IThresholdBehavior
|
|
{
|
|
[DataField("node")]
|
|
public string Node { get; private set; } = string.Empty;
|
|
|
|
public void Execute(EntityUid owner, DestructibleSystem system)
|
|
{
|
|
if (string.IsNullOrEmpty(Node) || !system.EntityManager.TryGetComponent(owner, out ConstructionComponent? construction))
|
|
return;
|
|
|
|
system.ConstructionSystem.ChangeNode(owner, null, Node, true, construction);
|
|
}
|
|
}
|
|
}
|