From 968190700662944e56dae52972217140d70523c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Sat, 8 Aug 2020 16:55:36 +0200 Subject: [PATCH] Fix bug where atmos could get stuck processing certain states for a long time --- .../Atmos/GridAtmosphereComponent.cs | 34 +++++++------------ 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs b/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs index b39440c520..0cd3f5ada0 100644 --- a/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs @@ -328,20 +328,20 @@ namespace Content.Server.GameObjects.Components.Atmos _state = ProcessState.ActiveTiles; return; case ProcessState.ActiveTiles: - if(ProcessActiveTiles()) - _state = ProcessState.ExcitedGroups; + ProcessActiveTiles(); + _state = ProcessState.ExcitedGroups; return; case ProcessState.ExcitedGroups: - if(ProcessExcitedGroups()) - _state = ProcessState.HighPressureDelta; + ProcessExcitedGroups(); + _state = ProcessState.HighPressureDelta; return; case ProcessState.HighPressureDelta: ProcessHighPressureDelta(); _state = ProcessState.Hotspots; break; case ProcessState.Hotspots: - if(ProcessHotspots()) - _state = ProcessState.TileEqualize; + ProcessHotspots(); + _state = ProcessState.TileEqualize; break; } @@ -363,11 +363,9 @@ namespace Content.Server.GameObjects.Components.Atmos if (_stopwatch.Elapsed.TotalMilliseconds >= LagCheckMaxMilliseconds) return; } - - return; } - public bool ProcessActiveTiles() + public void ProcessActiveTiles() { _stopwatch.Restart(); @@ -380,13 +378,11 @@ namespace Content.Server.GameObjects.Components.Atmos number = 0; // Process the rest next time. if (_stopwatch.Elapsed.TotalMilliseconds >= LagCheckMaxMilliseconds) - return false; + return; } - - return true; } - public bool ProcessExcitedGroups() + public void ProcessExcitedGroups() { _stopwatch.Restart(); @@ -406,10 +402,8 @@ namespace Content.Server.GameObjects.Components.Atmos number = 0; // Process the rest next time. if (_stopwatch.Elapsed.TotalMilliseconds >= LagCheckMaxMilliseconds) - return false; + return; } - - return true; } public void ProcessHighPressureDelta() @@ -430,11 +424,9 @@ namespace Content.Server.GameObjects.Components.Atmos if (_stopwatch.Elapsed.TotalMilliseconds >= LagCheckMaxMilliseconds) return; } - - return; } - private bool ProcessHotspots() + private void ProcessHotspots() { _stopwatch.Restart(); @@ -447,10 +439,8 @@ namespace Content.Server.GameObjects.Components.Atmos number = 0; // Process the rest next time. if (_stopwatch.Elapsed.TotalMilliseconds >= LagCheckMaxMilliseconds) - return false; + return; } - - return true; } private AirtightComponent GetObstructingComponent(MapIndices indices)