Files

20 lines
555 B
C#
Raw Permalink Normal View History

2024-01-27 15:19:52 +03:00
using Content.Shared.Mobs;
namespace Content.Server._White.BecomeDustOnDeathSystem;
2024-01-27 15:19:52 +03:00
public sealed class BecomeDustOnDeathSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<BecomeDustOnDeathComponent, MobStateChangedEvent>(OnMobStateChanged);
}
private void OnMobStateChanged(EntityUid uid, BecomeDustOnDeathComponent component, MobStateChangedEvent args)
{
var xform = Transform(uid);
Spawn(component.SpawnOnDeathPrototype, xform.Coordinates);
QueueDel(uid);
}
}