Minor artifact fixes (#13360)
* rename phasing artifact + fix it * fix wandering cant be scanned
This commit is contained in:
@@ -123,7 +123,7 @@ namespace Content.Server.Construction
|
||||
{
|
||||
if (!bodyQuery.TryGetComponent(ent, out var body) ||
|
||||
!body.CanCollide ||
|
||||
(!body.Hard && body.BodyType != BodyType.Static))
|
||||
!body.Hard)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
/// and such.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ClearFixturesArtifactComponent : Component
|
||||
public sealed class PhasingArtifactComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -2,35 +2,35 @@
|
||||
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
|
||||
using Content.Shared.Physics;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
|
||||
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
|
||||
|
||||
/// <summary>
|
||||
/// Handles allowing activated artifacts to phase through walls.
|
||||
/// </summary>
|
||||
public sealed class ClearFixturesArtifactSystem : EntitySystem
|
||||
public sealed class PhasingArtifactSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ClearFixturesArtifactComponent, ArtifactActivatedEvent>(OnActivate);
|
||||
SubscribeLocalEvent<PhasingArtifactComponent, ArtifactActivatedEvent>(OnActivate);
|
||||
}
|
||||
|
||||
private void OnActivate(EntityUid uid, ClearFixturesArtifactComponent component, ArtifactActivatedEvent args)
|
||||
private void OnActivate(EntityUid uid, PhasingArtifactComponent component, ArtifactActivatedEvent args)
|
||||
{
|
||||
if (!TryComp<FixturesComponent>(uid, out var fixtures))
|
||||
if (!TryComp<FixturesComponent>(uid, out var fixtures) || !TryComp<PhysicsComponent>(uid, out var phys))
|
||||
return;
|
||||
|
||||
foreach (var (_, fixture) in fixtures.Fixtures)
|
||||
{
|
||||
if (!fixture.Hard)
|
||||
continue;
|
||||
|
||||
fixture.CollisionLayer = (int) CollisionGroup.None;
|
||||
fixture.CollisionMask = (int) CollisionGroup.None;
|
||||
_physics.SetHard(fixture, false, fixtures);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user