Strap bug fixes (#10142)
This commit is contained in:
@@ -1,15 +1,29 @@
|
||||
using Content.Shared.Construction;
|
||||
using Content.Shared.Construction;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Server.Construction.Completions
|
||||
{
|
||||
public sealed class ConstructionBeforeDeleteEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public EntityUid? User;
|
||||
|
||||
public ConstructionBeforeDeleteEvent(EntityUid? user)
|
||||
{
|
||||
User = user;
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class DeleteEntity : IGraphAction
|
||||
{
|
||||
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
|
||||
{
|
||||
entityManager.DeleteEntity(uid);
|
||||
var ev = new ConstructionBeforeDeleteEvent(userUid);
|
||||
entityManager.EventBus.RaiseLocalEvent(uid, ev);
|
||||
|
||||
if (!ev.Cancelled)
|
||||
entityManager.DeleteEntity(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user