prevent pulse throw from throwing observers (#19704)
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Anomaly.Components;
|
||||
using Content.Shared.Anomaly.Effects.Components;
|
||||
using Content.Shared.Ghost;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Shared.Map;
|
||||
using Content.Shared.Physics;
|
||||
using Robust.Shared.Physics.Components;
|
||||
|
||||
namespace Content.Shared.Anomaly.Effects;
|
||||
|
||||
@@ -28,9 +31,14 @@ public abstract class SharedGravityAnomalySystem : EntitySystem
|
||||
var lookup = _lookup.GetEntitiesInRange(uid, range, LookupFlags.Dynamic | LookupFlags.Sundries);
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
var worldPos = _xform.GetWorldPosition(xform, xformQuery);
|
||||
var physQuery = GetEntityQuery<PhysicsComponent>();
|
||||
|
||||
foreach (var ent in lookup)
|
||||
{
|
||||
if (physQuery.TryGetComponent(ent, out var phys)
|
||||
&& (phys.CollisionMask & (int) CollisionGroup.GhostImpassable) != 0)
|
||||
continue;
|
||||
|
||||
var foo = _xform.GetWorldPosition(ent, xformQuery) - worldPos;
|
||||
_throwing.TryThrow(ent, foo * 10, strength, uid, 0);
|
||||
}
|
||||
@@ -51,9 +59,14 @@ public abstract class SharedGravityAnomalySystem : EntitySystem
|
||||
var strength = component.MaxThrowStrength * 2;
|
||||
var lookup = _lookup.GetEntitiesInRange(uid, range, LookupFlags.Dynamic | LookupFlags.Sundries);
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
var physQuery = GetEntityQuery<PhysicsComponent>();
|
||||
|
||||
foreach (var ent in lookup)
|
||||
{
|
||||
if (physQuery.TryGetComponent(ent, out var phys)
|
||||
&& (phys.CollisionMask & (int) CollisionGroup.GhostImpassable) != 0)
|
||||
continue;
|
||||
|
||||
var foo = _xform.GetWorldPosition(ent, xformQuery) - worldPos;
|
||||
_throwing.TryThrow(ent, foo * 5, strength, uid, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user