Replace IResettingEntitySystem with RoundRestartCleanupEvent. (#4245)

* Replace IResettingEntitySystem with RoundRestartCleanupEvent.

* oops
This commit is contained in:
Vera Aguilera Puerto
2021-06-29 15:56:07 +02:00
committed by GitHub
parent 16e1c2c798
commit bc7b315b18
27 changed files with 136 additions and 66 deletions

View File

@@ -21,7 +21,7 @@ namespace Content.Server.AI.Pathfinding.Accessible
/// </summary>
/// Long-term can be used to do hierarchical pathfinding
[UsedImplicitly]
public sealed class AiReachableSystem : EntitySystem, IResettingEntitySystem
public sealed class AiReachableSystem : EntitySystem
{
/*
* The purpose of this is to provide a higher-level / hierarchical abstraction of the actual pathfinding graph
@@ -81,6 +81,7 @@ namespace Content.Server.AI.Pathfinding.Accessible
public override void Initialize()
{
_pathfindingSystem = Get<PathfindingSystem>();
SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
SubscribeLocalEvent<PathfindingChunkUpdateMessage>(RecalculateNodeRegions);
#if DEBUG
SubscribeNetworkEvent<SharedAiDebug.SubscribeReachableMessage>(HandleSubscription);
@@ -699,7 +700,7 @@ namespace Content.Server.AI.Pathfinding.Accessible
#endif
}
public void Reset()
public void Reset(RoundRestartCleanupEvent ev)
{
_queuedUpdates.Clear();
_regions.Clear();