Fix chairs not unbuckling entities when deconstructed or destroyed (#3696)
This commit is contained in:
23
Content.Server/Construction/Completions/DestroyEntity.cs
Normal file
23
Content.Server/Construction/Completions/DestroyEntity.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user