Skip to content

Commit

Permalink
FixVacuum does not replace tile air if there are no adjacent tiles. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gradientvera authored Jul 8, 2022
1 parent 07c6224 commit 520464e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,10 @@ private void GridFixTileVacuum(EntityUid uid, GridAtmosphereComponent component,

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),
Expand All @@ -449,10 +453,6 @@ private void GridFixTileVacuum(EntityUid uid, GridAtmosphereComponent component,
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;

Expand Down

0 comments on commit 520464e

Please sign in to comment.