Fix AI mem leak? (#1482)

Holy shit I'm dumb for missing that AGAIN.

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-07-26 14:27:24 +10:00
committed by GitHub
parent 452c6b67dd
commit 4e1597eeb3
2 changed files with 9 additions and 0 deletions

View File

@@ -125,6 +125,13 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
_cachedAccessible.Clear();
}
public void ResettingCleanup()
{
_queuedUpdates.Clear();
_regions.Clear();
_cachedAccessible.Clear();
}
private void RecalculateNodeRegions(PathfindingChunkUpdateMessage message)
{
// TODO: Only need to do changed nodes ideally

View File

@@ -13,6 +13,7 @@ using Content.Server.GameObjects.Components.Observer;
using Content.Server.GameObjects.Components.PDA;
using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding;
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible;
using Content.Server.GameTicking.GamePresets;
using Content.Server.Interfaces;
using Content.Server.Interfaces.Chat;
@@ -622,6 +623,7 @@ namespace Content.Server.GameTicking
// Reset pathing system
EntitySystem.Get<PathfindingSystem>().ResettingCleanup();
EntitySystem.Get<AiReachableSystem>().ResettingCleanup();
_spawnedPositions.Clear();
_manifest.Clear();