Fix quantum dispose (#24772)
* Fix quantum disposable issue * remove force * Iterate over all the disposal holder children instead of contained ones
This commit is contained in:
@@ -36,8 +36,6 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
private EntityQuery<PhysicsComponent> _physicsQuery;
|
private EntityQuery<PhysicsComponent> _physicsQuery;
|
||||||
private EntityQuery<TransformComponent> _xformQuery;
|
private EntityQuery<TransformComponent> _xformQuery;
|
||||||
|
|
||||||
private List<EntityUid> _entList = new();
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -119,14 +117,16 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_entList.Clear();
|
// We're purposely iterating over all the holder's children
|
||||||
_entList.AddRange(holder.Container.ContainedEntities);
|
// because the holder might have something teleported into it,
|
||||||
|
// outside the usual container insertion logic.
|
||||||
foreach (var entity in _entList)
|
var children = holderTransform.ChildEnumerator;
|
||||||
|
while (children.MoveNext(out var entity))
|
||||||
{
|
{
|
||||||
RemComp<BeingDisposedComponent>(entity);
|
RemComp<BeingDisposedComponent>(entity);
|
||||||
|
|
||||||
var meta = _metaQuery.GetComponent(entity);
|
var meta = _metaQuery.GetComponent(entity);
|
||||||
|
if (holder.Container.Contains(entity))
|
||||||
_containerSystem.Remove((entity, null, meta), holder.Container, reparent: false, force: true);
|
_containerSystem.Remove((entity, null, meta), holder.Container, reparent: false, force: true);
|
||||||
|
|
||||||
var xform = _xformQuery.GetComponent(entity);
|
var xform = _xformQuery.GetComponent(entity);
|
||||||
|
|||||||
Reference in New Issue
Block a user