Move TimedDespawn to engine (#20515)
This commit is contained in:
@@ -12,6 +12,7 @@ public sealed class SpawnerSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<TimedSpawnerComponent, ComponentInit>(OnSpawnerInit);
|
||||
SubscribeLocalEvent<TimedSpawnerComponent, ComponentShutdown>(OnTimedSpawnerShutdown);
|
||||
}
|
||||
|
||||
private void OnSpawnerInit(EntityUid uid, TimedSpawnerComponent component, ComponentInit args)
|
||||
@@ -35,4 +36,9 @@ public sealed class SpawnerSystem : EntitySystem
|
||||
Spawn(entity, coordinates);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTimedSpawnerShutdown(EntityUid uid, TimedSpawnerComponent component, ComponentShutdown args)
|
||||
{
|
||||
component.TokenSource?.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user