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