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,20 +1,14 @@
using System;
using System.Collections.Generic;
using Content.Shared.Construction;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Examine;
using Content.Shared.Input;
using Content.Shared.Interaction.Helpers;
using Content.Shared.Interaction;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Input;
using Robust.Shared.Input.Binding;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
namespace Content.Client.Construction
@@ -27,6 +21,7 @@ namespace Content.Client.Construction
{
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
private readonly Dictionary<int, ConstructionGhostComponent> _ghosts = new();
private readonly Dictionary<string, ConstructionGuide> _guideCache = new();
@@ -162,8 +157,12 @@ namespace Content.Client.Construction
return;
}
if (GhostPresent(loc)) return;
// This InRangeUnobstructed should probably be replaced with "is there something blocking us in that tile?"
if (GhostPresent(loc) || !user.InRangeUnobstructed(loc, 20f, ignoreInsideBlocker: prototype.CanBuildInImpassable)) return;
var predicate = GetPredicate(prototype.CanBuildInImpassable, loc.ToMap(EntityManager));
if (!_interactionSystem.InRangeUnobstructed(user, loc, 20f, predicate: predicate))
return;
foreach (var condition in prototype.Conditions)
{