Fix parallel tests unreliably failing due to statics in Atmospherics (#1914)

* Fix atmospherics statics unreliably failing parallel tests

* Cache getting atmosphere system
This commit is contained in:
DrSmugleaf
2020-08-25 16:14:26 +02:00
committed by GitHub
parent f436429a81
commit 4f8fbe2749
11 changed files with 107 additions and 73 deletions

View File

@@ -159,7 +159,8 @@ namespace Content.Server.GameObjects.Components.Atmos
pos = _position.Value;
}
var gam = EntitySystem.Get<AtmosphereSystem>().GetGridAtmosphere(pos.GridID);
var atmosSystem = EntitySystem.Get<AtmosphereSystem>();
var gam = atmosSystem.GetGridAtmosphere(pos.GridID);
var tile = gam?.GetTile(pos).Air;
if (tile == null)
{
@@ -174,9 +175,10 @@ namespace Content.Server.GameObjects.Components.Atmos
}
var gases = new List<GasEntry>();
for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++)
{
var gas = Atmospherics.GetGas(i);
var gas = atmosSystem.GetGas(i);
if (tile.Gases[i] <= Atmospherics.GasMinMoles) continue;