Remove the last comp shutdown methods (#13582)
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Content.Server.Spawners.Components
|
|||||||
[DataField("MaximumEntitiesSpawned")]
|
[DataField("MaximumEntitiesSpawned")]
|
||||||
public int MaximumEntitiesSpawned { get; set; } = 1;
|
public int MaximumEntitiesSpawned { get; set; } = 1;
|
||||||
|
|
||||||
private CancellationTokenSource? TokenSource;
|
public CancellationTokenSource? TokenSource;
|
||||||
|
|
||||||
void ISerializationHooks.AfterDeserialization()
|
void ISerializationHooks.AfterDeserialization()
|
||||||
{
|
{
|
||||||
@@ -45,12 +45,6 @@ namespace Content.Server.Spawners.Components
|
|||||||
SetupTimer();
|
SetupTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Shutdown()
|
|
||||||
{
|
|
||||||
base.Shutdown();
|
|
||||||
TokenSource?.Cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetupTimer()
|
private void SetupTimer()
|
||||||
{
|
{
|
||||||
TokenSource?.Cancel();
|
TokenSource?.Cancel();
|
||||||
|
|||||||
@@ -1,9 +1,21 @@
|
|||||||
|
using Content.Server.Spawners.Components;
|
||||||
using Content.Shared.Spawners.EntitySystems;
|
using Content.Shared.Spawners.EntitySystems;
|
||||||
|
|
||||||
namespace Content.Server.Spawners.EntitySystems;
|
namespace Content.Server.Spawners.EntitySystems;
|
||||||
|
|
||||||
public sealed class TimedDespawnSystem : SharedTimedDespawnSystem
|
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)
|
protected override bool CanDelete(EntityUid uid)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -18,12 +18,6 @@
|
|||||||
[DataField("needsHands")]
|
[DataField("needsHands")]
|
||||||
public bool NeedsHands = true;
|
public bool NeedsHands = true;
|
||||||
|
|
||||||
protected override void Shutdown()
|
|
||||||
{
|
|
||||||
EntitySystem.Get<SharedPullingStateManagementSystem>().ForceDisconnectPuller(this);
|
|
||||||
base.Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnRemove()
|
protected override void OnRemove()
|
||||||
{
|
{
|
||||||
if (Pulling != default)
|
if (Pulling != default)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ namespace Content.Shared.Pulling.Systems
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public sealed class SharedPullerSystem : EntitySystem
|
public sealed class SharedPullerSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly SharedPullingStateManagementSystem _why = default!;
|
||||||
[Dependency] private readonly SharedPullingSystem _pullSystem = default!;
|
[Dependency] private readonly SharedPullingSystem _pullSystem = default!;
|
||||||
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!;
|
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!;
|
||||||
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
|
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
|
||||||
@@ -25,6 +26,12 @@ namespace Content.Shared.Pulling.Systems
|
|||||||
SubscribeLocalEvent<SharedPullerComponent, PullStoppedMessage>(PullerHandlePullStopped);
|
SubscribeLocalEvent<SharedPullerComponent, PullStoppedMessage>(PullerHandlePullStopped);
|
||||||
SubscribeLocalEvent<SharedPullerComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted);
|
SubscribeLocalEvent<SharedPullerComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted);
|
||||||
SubscribeLocalEvent<SharedPullerComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovespeed);
|
SubscribeLocalEvent<SharedPullerComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovespeed);
|
||||||
|
SubscribeLocalEvent<SharedPullerComponent, ComponentShutdown>(OnPullerShutdown);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPullerShutdown(EntityUid uid, SharedPullerComponent component, ComponentShutdown args)
|
||||||
|
{
|
||||||
|
_why.ForceDisconnectPuller(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnVirtualItemDeleted(EntityUid uid, SharedPullerComponent component, VirtualItemDeletedEvent args)
|
private void OnVirtualItemDeleted(EntityUid uid, SharedPullerComponent component, VirtualItemDeletedEvent args)
|
||||||
|
|||||||
Reference in New Issue
Block a user