Fix chairs not unbuckling entities when deconstructed or destroyed (#3696)

This commit is contained in:
ShadowCommander
2021-03-18 02:48:17 -07:00
committed by GitHub
parent a93e9e9401
commit 45d93d8faa
3 changed files with 37 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
#nullable enable
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using System.Threading.Tasks;
namespace Content.Server.Construction.Completions
{
[UsedImplicitly]
[DataDefinition]
public class DestroyEntity : IGraphAction
{
public async Task PerformAction(IEntity entity, IEntity? user)
{
if (entity.Deleted) return;
var destructibleSystem = EntitySystem.Get<DestructibleSystem>();
destructibleSystem.ActSystem.HandleDestruction(entity);
}
}
}