Replace IResettingEntitySystem with RoundRestartCleanupEvent. (#4245)
* Replace IResettingEntitySystem with RoundRestartCleanupEvent. * oops
This commit is contained in:
committed by
GitHub
parent
16e1c2c798
commit
bc7b315b18
@@ -9,12 +9,19 @@ using Robust.Shared.Timing;
|
||||
namespace Content.Server.APC
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal sealed class ApcNetSystem : EntitySystem, IResettingEntitySystem
|
||||
internal sealed class ApcNetSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPauseManager _pauseManager = default!;
|
||||
|
||||
private HashSet<IApcNet> _apcNets = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
foreach (var apcNet in _apcNets)
|
||||
@@ -35,7 +42,7 @@ namespace Content.Server.APC
|
||||
_apcNets.Remove(apcNet);
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
public void Reset(RoundRestartCleanupEvent ev)
|
||||
{
|
||||
// NodeGroupSystem does not remake ApcNets affected during restarting until a frame later,
|
||||
// when their grid is invalid. So, we are clearing them on round restart.
|
||||
|
||||
Reference in New Issue
Block a user