Fix crash when the round restarts (#1161)

This commit is contained in:
DrSmugleaf
2020-06-21 17:28:43 +02:00
committed by GitHub
parent b1d3f0403a
commit ac19ad7eac
2 changed files with 9 additions and 0 deletions

View File

@@ -198,6 +198,11 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding
_mapManager.TileChanged -= QueueTileChange;
}
public void ResettingCleanup()
{
_queuedGraphUpdates.Clear();
}
private void QueueGridRemoval(GridId gridId)
{
_queuedGraphUpdates.Enqueue(new GridRemoval(gridId));

View File

@@ -9,6 +9,7 @@ using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Observer;
using Content.Server.GameObjects.Components.PDA;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding;
using Content.Server.GameTicking.GamePresets;
using Content.Server.Interfaces;
using Content.Server.Interfaces.Chat;
@@ -506,6 +507,9 @@ namespace Content.Server.GameTicking
_playerJoinLobby(player);
}
// Reset pathing system
EntitySystem.Get<PathfindingSystem>().ResettingCleanup();
_spawnedPositions.Clear();
_manifest.Clear();