Remove ignore-inside-blocker (#6692)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2022-02-17 15:40:03 +13:00
committed by GitHub
parent 00c3a181d3
commit 4a00d01ced
60 changed files with 297 additions and 872 deletions

View File

@@ -1,13 +1,29 @@
using System;
using Robust.Shared.GameObjects;
using System.Linq;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using static Content.Shared.Interaction.SharedInteractionSystem;
namespace Content.Shared.Construction
{
public abstract class SharedConstructionSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
/// <summary>
/// Get predicate for construction obstruction checks.
/// </summary>
public Ignored? GetPredicate(bool canBuildInImpassable, MapCoordinates coords)
{
if (!canBuildInImpassable)
return null;
if (!_mapManager.TryFindGridAt(coords, out var grid))
return null;
var ignored = grid.GetAnchoredEntities(coords).ToHashSet();
return e => ignored.Contains(e);
}
/// <summary>
/// Sent client -> server to to tell the server that we started building
/// a structure-construction.