Rename SmokeDissipateSpawnComponent to SpawnOnDespawnComponent (#20782)

This commit is contained in:
deltanedas
2023-10-11 07:34:51 +01:00
committed by GitHub
parent d4667477a5
commit e911c9e516
5 changed files with 42 additions and 29 deletions

View File

@@ -0,0 +1,22 @@
using Content.Server.Spawners.Components;
using Robust.Shared.Spawners;
namespace Content.Server.Spawners.EntitySystems;
public sealed class SpawnOnDespawnSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SpawnOnDespawnComponent, TimedDespawnEvent>(OnDespawn);
}
private void OnDespawn(EntityUid uid, SpawnOnDespawnComponent comp, ref TimedDespawnEvent args)
{
if (!TryComp<TransformComponent>(uid, out var xform))
return;
Spawn(comp.Prototype, xform.Coordinates);
}
}