mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Delete EntityDeletedMessage (#4329)
This commit is contained in:
@@ -546,20 +546,6 @@ namespace Robust.Shared.GameObjects
|
||||
}
|
||||
|
||||
_eventBus.OnEntityDeleted(uid);
|
||||
|
||||
// Another try-catch, so quickly after the other one?!
|
||||
// Yes. Both of these are try-catch blocks for *events*, which take our precious execution flow away from
|
||||
// us and into whatever spooky code subscribed to this. We don't want an exception in user code suddenly
|
||||
// fucking up entity deletion and leaving us with a frankesteintity, now do we?
|
||||
try
|
||||
{
|
||||
EventBus.RaiseEvent(EventSource.Local, new EntityDeletedMessage(uid));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_sawmill.Error($"Caught exception while raising {nameof(EntityDeletedMessage)} on '{ToPrettyString(uid, metadata)}'\n{e}");
|
||||
}
|
||||
|
||||
Entities.Remove(uid);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace Robust.Shared.GameObjects
|
||||
{
|
||||
public sealed class EntityDeletedMessage : EntityEventArgs
|
||||
{
|
||||
public EntityUid Entity { get; }
|
||||
|
||||
public EntityDeletedMessage(EntityUid entity)
|
||||
{
|
||||
Entity = entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user