Make PathfindingSystem take a nap during large explosions (#12309)

This commit is contained in:
Leon Friedrich
2022-11-04 14:24:41 +13:00
committed by GitHub
parent a0627b7558
commit 86ef8c5473
4 changed files with 35 additions and 8 deletions

View File

@@ -45,7 +45,14 @@ namespace Content.Server.NodeContainer.EntitySystems
private int _gen = 1;
private int _groupNetIdCounter = 1;
public bool Snoozing = false;
/// <summary>
/// If true, UpdateGrid() will not process grids.
/// </summary>
/// <remarks>
/// Useful if something like a large explosion is in the process of shredding the grid, as it avoids uneccesary
/// updating.
/// </remarks>
public bool PauseUpdating = false;
public override void Initialize()
{
@@ -135,7 +142,7 @@ namespace Content.Server.NodeContainer.EntitySystems
{
base.Update(frameTime);
if (!Snoozing)
if (!PauseUpdating)
{
DoGroupUpdates();
VisDoUpdate(frameTime);