20 lines
555 B
C#
20 lines
555 B
C#
using Content.Shared.Mobs;
|
|
|
|
namespace Content.Server._White.BecomeDustOnDeathSystem;
|
|
|
|
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);
|
|
}
|
|
}
|