Remove the last comp shutdown methods (#13582)
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Content.Server.Spawners.Components
|
||||
[DataField("MaximumEntitiesSpawned")]
|
||||
public int MaximumEntitiesSpawned { get; set; } = 1;
|
||||
|
||||
private CancellationTokenSource? TokenSource;
|
||||
public CancellationTokenSource? TokenSource;
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
{
|
||||
@@ -45,12 +45,6 @@ namespace Content.Server.Spawners.Components
|
||||
SetupTimer();
|
||||
}
|
||||
|
||||
protected override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
TokenSource?.Cancel();
|
||||
}
|
||||
|
||||
private void SetupTimer()
|
||||
{
|
||||
TokenSource?.Cancel();
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
using Content.Server.Spawners.Components;
|
||||
using Content.Shared.Spawners.EntitySystems;
|
||||
|
||||
namespace Content.Server.Spawners.EntitySystems;
|
||||
|
||||
public sealed class TimedDespawnSystem : SharedTimedDespawnSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<TimedSpawnerComponent, ComponentShutdown>(OnTimedSpawnerShutdown);
|
||||
}
|
||||
|
||||
private void OnTimedSpawnerShutdown(EntityUid uid, TimedSpawnerComponent component, ComponentShutdown args)
|
||||
{
|
||||
component.TokenSource?.Cancel();
|
||||
}
|
||||
|
||||
protected override bool CanDelete(EntityUid uid)
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user