mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Add additional container assert (#3397)
This commit is contained in:
@@ -207,6 +207,7 @@ namespace Robust.Shared.Containers
|
||||
IoCManager.Resolve(ref entMan);
|
||||
DebugTools.Assert(entMan.EntityExists(toremove));
|
||||
DebugTools.Assert(xform == null || xform.Owner == toremove);
|
||||
DebugTools.Assert(entMan.GetComponent<MetaDataComponent>(Owner).EntityLifeStage < EntityLifeStage.Terminating);
|
||||
|
||||
if (!CanRemove(toremove, entMan)) return false;
|
||||
InternalRemove(toremove, entMan, meta);
|
||||
|
||||
@@ -333,11 +333,8 @@ namespace Robust.Shared.GameObjects
|
||||
{
|
||||
var transform = xformQuery.GetComponent(metadata.Owner);
|
||||
metadata.EntityLifeStage = EntityLifeStage.Terminating;
|
||||
var ev = new EntityTerminatingEvent(metadata.Owner);
|
||||
|
||||
// TODO: consider making this a meta-data flag?
|
||||
// veeeery few entities make use of this event.
|
||||
EventBus.RaiseLocalEvent(metadata.Owner, ref ev, false);
|
||||
var ev = new EntityTerminatingEvent();
|
||||
EventBus.RaiseLocalEvent(metadata.Owner, ref ev);
|
||||
|
||||
foreach (var child in transform._children)
|
||||
{
|
||||
|
||||
@@ -4,13 +4,7 @@ namespace Robust.Shared.GameObjects
|
||||
/// The children of this entity are about to be deleted.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public struct EntityTerminatingEvent
|
||||
public readonly struct EntityTerminatingEvent
|
||||
{
|
||||
public EntityUid Owner;
|
||||
|
||||
public EntityTerminatingEvent(EntityUid uid)
|
||||
{
|
||||
Owner = uid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user