mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Replace usages of EntityQuery with dependency injected ones in Content.Server * Remove unused EntityQuery dependencies * Restore CheckPressureAndFire override method * Revert EntityQuery refactor changes to DisposalTubeSystem.cs & DisposableSystem.cs * Infer Transform/Metadata directly instead of passing (#43479) * Resolve RA0049, RA0051 errors (#43479) * Resolve RA0049, RA0051 errors (#43479) * Apply suggestions from code review Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
32 lines
937 B
C#
32 lines
937 B
C#
using Content.Shared.Shuttles.Components;
|
|
using Robust.Shared.Physics;
|
|
using Robust.Shared.Physics.Dynamics;
|
|
using Robust.Shared.Physics.Events;
|
|
|
|
namespace Content.Server.Shuttles.Systems;
|
|
|
|
/// <summary>
|
|
/// Deletes anything with <see cref="SpaceGarbageComponent"/> that has a cross-grid collision with a static body.
|
|
/// </summary>
|
|
public sealed class SpaceGarbageSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<SpaceGarbageComponent, StartCollideEvent>(OnCollide);
|
|
}
|
|
|
|
private void OnCollide(EntityUid uid, SpaceGarbageComponent component, ref StartCollideEvent args)
|
|
{
|
|
if (args.OtherBody.BodyType != BodyType.Static)
|
|
return;
|
|
|
|
var ourXform = Transform(uid);
|
|
var otherXform = Transform(args.OtherEntity);
|
|
|
|
if (ourXform.GridUid == otherXform.GridUid)
|
|
return;
|
|
|
|
QueueDel(uid);
|
|
}
|
|
}
|