Removes obsolete uses of IMapManager events. (#7036)

This commit is contained in:
ScalyChimp
2022-03-09 07:39:03 +01:00
committed by GitHub
parent df858100af
commit d691161542
7 changed files with 45 additions and 68 deletions

View File

@@ -83,11 +83,11 @@ namespace Content.Server.AI.Pathfinding.Accessible
{
SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
SubscribeLocalEvent<PathfindingChunkUpdateMessage>(RecalculateNodeRegions);
SubscribeLocalEvent<GridRemovalEvent>(GridRemoved);
#if DEBUG
SubscribeNetworkEvent<SharedAiDebug.SubscribeReachableMessage>(HandleSubscription);
SubscribeNetworkEvent<SharedAiDebug.UnsubscribeReachableMessage>(HandleUnsubscription);
#endif
_mapManager.OnGridRemoved += GridRemoved;
}
public override void Shutdown()
@@ -99,12 +99,11 @@ namespace Content.Server.AI.Pathfinding.Accessible
_cachedAccessible.Clear();
_queuedCacheDeletions.Clear();
_mapManager.OnGridRemoved -= GridRemoved;
}
private void GridRemoved(MapId mapId, GridId gridId)
private void GridRemoved(GridRemovalEvent ev)
{
_regions.Remove(gridId);
_regions.Remove(ev.GridId);
}
public override void Update(float frameTime)