Fix misc container and lookup bugs (#3418)

This commit is contained in:
Leon Friedrich
2022-10-31 14:54:37 +13:00
committed by GitHub
parent 2f3f7976f1
commit ffe1689be6
3 changed files with 5 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ namespace Robust.Shared.Containers
/// <inheritdoc />
protected override void InternalShutdown(IEntityManager entMan, bool isClient)
{
foreach (var entity in _containerList)
foreach (var entity in _containerList.ToArray())
{
if (!isClient)
entMan.DeleteEntity(entity);

View File

@@ -367,7 +367,7 @@ public sealed partial class EntityLookupSystem
{
AddEntitiesIntersecting(grid.GridEntityId, intersecting, worldAABB, flags, lookupQuery, xformQuery);
if ((flags & LookupFlags.Anchored) != 0x0)
if ((flags & (LookupFlags.Anchored | LookupFlags.Static)) != 0x0)
{
foreach (var uid in grid.GetAnchoredEntities(worldAABB))
{
@@ -480,7 +480,7 @@ public sealed partial class EntityLookupSystem
if (mapPos.MapId == MapId.Nullspace) return new HashSet<EntityUid>();
var intersecting = GetEntitiesInRange(mapPos, range, flags).ToHashSet();
var intersecting = GetEntitiesInRange(mapPos, range, flags);
intersecting.Remove(uid);
return intersecting;
}
@@ -495,7 +495,7 @@ public sealed partial class EntityLookupSystem
var (worldPos, worldRot) = xform.GetWorldPositionRotation();
var bounds = GetAABBNoContainer(uid, worldPos, worldRot);
var intersecting = GetEntitiesIntersecting(mapId, bounds, flags).ToHashSet();
var intersecting = GetEntitiesIntersecting(mapId, bounds, flags);
intersecting.Remove(uid);
return intersecting;
}

View File

@@ -331,7 +331,7 @@ namespace Robust.UnitTesting.Server.GameObjects.Components
/// <inheritdoc />
protected override void InternalShutdown(IEntityManager entMan, bool isClient)
{
foreach (var entity in _containerList)
foreach (var entity in _containerList.ToArray())
{
if (!isClient)
entMan.DeleteEntity(entity);