Better Godmode (#37020)

* Commit

* Oversights oops

* breaking changes

* unbreaking changes

* Compatibility with AfterFullyEaten

* Fixed

* Update Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-05-09 22:06:19 -07:00
committed by GitHub
parent 4407eab96b
commit 62c380fc53
6 changed files with 40 additions and 7 deletions

View File

@@ -5,12 +5,18 @@ public abstract class SharedDestructibleSystem : EntitySystem
/// <summary>
/// Force entity to be destroyed and deleted.
/// </summary>
public void DestroyEntity(EntityUid owner)
public bool DestroyEntity(EntityUid owner)
{
var eventArgs = new DestructionEventArgs();
var ev = new DestructionAttemptEvent();
RaiseLocalEvent(owner, ev);
if (ev.Cancelled)
return false;
var eventArgs = new DestructionEventArgs();
RaiseLocalEvent(owner, eventArgs);
QueueDel(owner);
return true;
}
/// <summary>
@@ -23,6 +29,14 @@ public abstract class SharedDestructibleSystem : EntitySystem
}
}
/// <summary>
/// Raised before an entity is about to be destroyed and deleted
/// </summary>
public sealed class DestructionAttemptEvent : CancellableEntityEventArgs
{
}
/// <summary>
/// Raised when entity is destroyed and about to be deleted.
/// </summary>