FixVacuum does not replace tile air if there are no adjacent tiles. (#9535)

This commit is contained in:
Vera Aguilera Puerto
2022-07-08 12:41:59 +02:00
committed by GitHub
parent 07c622429a
commit 520464e89b

View File

@@ -440,6 +440,10 @@ public sealed partial class AtmosphereSystem
var adjacent = adjEv.Result!.ToArray();
// Return early, let's not cause any funny NaNs or needless vacuums.
if (adjacent.Length == 0)
return;
tile.Air = new GasMixture
{
Volume = GetVolumeForTiles(mapGridComp.Grid, 1),
@@ -449,10 +453,6 @@ public sealed partial class AtmosphereSystem
tile.MolesArchived = new float[Atmospherics.AdjustedNumberOfGases];
tile.ArchivedCycle = 0;
// Return early, let's not cause any funny NaNs.
if (adjacent.Length == 0)
return;
var ratio = 1f / adjacent.Length;
var totalTemperature = 0f;