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

@@ -6,6 +6,7 @@ using Content.Server.Explosion.Components;
using Content.Shared.Acts;
using Content.Shared.Camera;
using Content.Shared.Database;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Helpers;
using Content.Shared.Maps;
using Content.Shared.Physics;
@@ -27,6 +28,8 @@ namespace Content.Server.Explosion.EntitySystems
{
public sealed class ExplosionSystem : EntitySystem
{
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
/// <summary>
/// Distance used for camera shake when distance from explosion is (0.0, 0.0).
/// Avoids getting NaN values down the line from doing math on (0.0, 0.0).
@@ -174,7 +177,7 @@ namespace Content.Server.Explosion.EntitySystems
var epicenterMapPos = epicenter.ToMap(EntityManager);
foreach (var (entity, distance) in impassableEntities)
{
if (!entity.InRangeUnobstructed(epicenterMapPos, maxRange, ignoreInsideBlocker: true, predicate: IgnoreExplosivePassable))
if (!_interactionSystem.InRangeUnobstructed(epicenterMapPos, entity, maxRange, predicate: IgnoreExplosivePassable))
{
continue;
}
@@ -186,7 +189,7 @@ namespace Content.Server.Explosion.EntitySystems
// there are probably more ExplosivePassable entities around
foreach (var (entity, distance) in nonImpassableEntities)
{
if (!entity.InRangeUnobstructed(epicenterMapPos, maxRange, ignoreInsideBlocker: true, predicate: IgnoreExplosivePassable))
if (!_interactionSystem.InRangeUnobstructed(epicenterMapPos, entity, maxRange, predicate: IgnoreExplosivePassable))
{
continue;
}
@@ -235,7 +238,7 @@ namespace Content.Server.Explosion.EntitySystems
continue;
}
if (!tileLoc.ToMap(EntityManager).InRangeUnobstructed(epicenterMapPos, maxRange, ignoreInsideBlocker: false, predicate: IgnoreExplosivePassable))
if (!_interactionSystem.InRangeUnobstructed(tileLoc.ToMap(EntityManager), epicenterMapPos, maxRange, predicate: IgnoreExplosivePassable))
{
continue;
}