using Content.Server.Gatherable.Components; using Content.Shared.Projectiles; using Robust.Shared.Physics.Events; namespace Content.Server.Gatherable; public sealed partial class GatherableSystem { private void InitializeProjectile() { SubscribeLocalEvent(OnProjectileCollide); } private void OnProjectileCollide(Entity gathering, ref StartCollideEvent args) { if (!args.OtherFixture.Hard || args.OurFixtureId != SharedProjectileSystem.ProjectileFixture || gathering.Comp.Amount <= 0 || !TryComp(args.OtherEntity, out var gatherable)) { return; } Gather(args.OtherEntity, gathering, gatherable); gathering.Comp.Amount--; if (gathering.Comp.Amount <= 0) QueueDel(gathering); } }