Files
Spatison 2a10c02eb5 No spead merge (#475)
* Revert "[GoobPort] WIZ REAL (#465)"

This reverts commit 091a8ff433.

* fix local
2025-04-26 10:50:32 +03:00

23 lines
601 B
C#

using Content.Shared.Projectiles;
namespace Content.Shared._Goobstation.Projectiles.SpawnEntitiesOnHit;
public sealed class SpawnEntitiesOnHitSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SpawnEntitiesOnHitComponent, ProjectileHitEvent>(OnHit);
}
private void OnHit(Entity<SpawnEntitiesOnHitComponent> ent, ref ProjectileHitEvent args)
{
var coords = Transform(ent).Coordinates;
for (var i = 0; i < ent.Comp.Amount; i++)
{
Spawn(ent.Comp.Proto, coords);
}
}
}