prevent pulse throw from throwing observers (#19704)

This commit is contained in:
qwerltaz
2023-09-04 06:52:11 +02:00
committed by GitHub
parent 5fe9e06ef3
commit b6da21fd3e
2 changed files with 21 additions and 0 deletions

View File

@@ -2,9 +2,12 @@
using Content.Server.Maps;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Shared.Ghost;
using Content.Shared.Maps;
using Content.Shared.Physics;
using Content.Shared.Throwing;
using Robust.Shared.Map;
using Robust.Shared.Physics.Components;
using Robust.Shared.Random;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
@@ -41,8 +44,13 @@ public sealed class ThrowArtifactSystem : EntitySystem
}
var lookup = _lookup.GetEntitiesInRange(uid, component.Range, LookupFlags.Dynamic | LookupFlags.Sundries);
var physQuery = GetEntityQuery<PhysicsComponent>();
foreach (var ent in lookup)
{
if (physQuery.TryGetComponent(ent, out var phys)
&& (phys.CollisionMask & (int) CollisionGroup.GhostImpassable) != 0)
continue;
var tempXform = Transform(ent);
var foo = tempXform.MapPosition.Position - xform.MapPosition.Position;