mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Make every EntitySystem partial * Oobs thats for a diff PR * Also oops on that one * Test systems * git are we fr * Update file templates * cleanup empty classes while we are here * forgor --------- Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
32 lines
945 B
C#
32 lines
945 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 partial 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);
|
|
}
|
|
}
|