Atmos high pressure movements cleanup (#8075)

* Fixes LINDA and monstermos clashing over high pressure difference direction

* Fix space wind CVar not disabling space wind entirely.

* Change 1 (one) variable name
This commit is contained in:
Vera Aguilera Puerto
2022-05-10 12:56:17 +02:00
committed by GitHub
parent d7168fedd1
commit 8232d91ad4
4 changed files with 37 additions and 29 deletions

View File

@@ -547,18 +547,17 @@ namespace Content.Server.Atmos.EntitySystems
var amount = transferDirections[i];
var otherTile = tile.AdjacentTiles[i];
if (otherTile?.Air == null) continue;
if (amount > 0)
{
// Everything that calls this method already ensures that Air will not be null.
if (tile.Air!.TotalMoles < amount)
FinalizeEqNeighbors(gridAtmosphere, tile, transferDirections);
if (amount <= 0) continue;
otherTile.MonstermosInfo[direction.GetOpposite()] = 0;
Merge(otherTile.Air, tile.Air.Remove(amount));
InvalidateVisuals(tile.GridIndex, tile.GridIndices);
InvalidateVisuals(otherTile.GridIndex, otherTile.GridIndices);
ConsiderPressureDifference(gridAtmosphere, tile, otherTile, amount);
}
// Everything that calls this method already ensures that Air will not be null.
if (tile.Air!.TotalMoles < amount)
FinalizeEqNeighbors(gridAtmosphere, tile, transferDirections);
otherTile.MonstermosInfo[direction.GetOpposite()] = 0;
Merge(otherTile.Air, tile.Air.Remove(amount));
InvalidateVisuals(tile.GridIndex, tile.GridIndices);
InvalidateVisuals(otherTile.GridIndex, otherTile.GridIndices);
ConsiderPressureDifference(gridAtmosphere, tile, direction, amount);
}
}