Salvage dungeons (#14520)

This commit is contained in:
metalgearsloth
2023-03-10 16:41:22 +11:00
committed by GitHub
parent 214ca06997
commit 6157dfa3c0
145 changed files with 24649 additions and 396 deletions

View File

@@ -10,6 +10,7 @@ using Content.Shared.Pulling.Components;
using Content.Shared.Tools;
using Content.Shared.Tools.Components;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
namespace Content.Server.Construction
@@ -99,7 +100,12 @@ namespace Content.Server.Construction
return false;
var tileIndices = grid.TileIndicesFor(coordinates);
var enumerator = grid.GetAnchoredEntitiesEnumerator(tileIndices);
return TileFree(grid, tileIndices, anchorBody.CollisionLayer, anchorBody.CollisionMask);
}
public bool TileFree(MapGridComponent grid, Vector2i gridIndices, int collisionLayer = 0, int collisionMask = 0)
{
var enumerator = grid.GetAnchoredEntitiesEnumerator(gridIndices);
var bodyQuery = GetEntityQuery<PhysicsComponent>();
while (enumerator.MoveNext(out var ent))
@@ -111,8 +117,8 @@ namespace Content.Server.Construction
continue;
}
if ((body.CollisionMask & anchorBody.CollisionLayer) != 0x0 ||
(body.CollisionLayer & anchorBody.CollisionMask) != 0x0)
if ((body.CollisionMask & collisionLayer) != 0x0 ||
(body.CollisionLayer & collisionMask) != 0x0)
{
return false;
}