Delete EntityDeletedMessage (#4329)

This commit is contained in:
metalgearsloth
2023-08-29 05:21:29 +10:00
committed by GitHub
parent 2b8d8d6636
commit cd13cd3cd8
2 changed files with 0 additions and 26 deletions

View File

@@ -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);
}

View File

@@ -1,12 +0,0 @@
namespace Robust.Shared.GameObjects
{
public sealed class EntityDeletedMessage : EntityEventArgs
{
public EntityUid Entity { get; }
public EntityDeletedMessage(EntityUid entity)
{
Entity = entity;
}
}
}