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:
committed by
GitHub
parent
d7168fedd1
commit
8232d91ad4
@@ -104,6 +104,19 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (tile.PressureDifference > 100)
|
||||||
|
{
|
||||||
|
// TODO ATMOS Do space wind graphics here!
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_spaceWindSoundCooldown++ > SpaceWindSoundCooldownCycles)
|
||||||
|
_spaceWindSoundCooldown = 0;
|
||||||
|
|
||||||
|
// No atmos yeets, return early.
|
||||||
|
if (!SpaceWind)
|
||||||
|
return;
|
||||||
|
|
||||||
// Used by ExperiencePressureDifference to correct push/throw directions from tile-relative to physics world.
|
// Used by ExperiencePressureDifference to correct push/throw directions from tile-relative to physics world.
|
||||||
var gridWorldRotation = xforms.GetComponent(gridAtmosphere.Owner).WorldRotation;
|
var gridWorldRotation = xforms.GetComponent(gridAtmosphere.Owner).WorldRotation;
|
||||||
|
|
||||||
@@ -134,25 +147,18 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.PressureDifference > 100)
|
|
||||||
{
|
|
||||||
// TODO ATMOS Do space wind graphics here!
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_spaceWindSoundCooldown++ > SpaceWindSoundCooldownCycles)
|
|
||||||
_spaceWindSoundCooldown = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called from AtmosphereSystem.LINDA.cs with SpaceWind CVar check handled there.
|
// Called from AtmosphereSystem.LINDA.cs with SpaceWind CVar check handled there.
|
||||||
private void ConsiderPressureDifference(GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile, TileAtmosphere other, float difference)
|
private void ConsiderPressureDifference(GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile, AtmosDirection differenceDirection, float difference)
|
||||||
{
|
{
|
||||||
gridAtmosphere.HighPressureDelta.Add(tile);
|
gridAtmosphere.HighPressureDelta.Add(tile);
|
||||||
if (difference > tile.PressureDifference)
|
|
||||||
{
|
if (difference <= tile.PressureDifference)
|
||||||
tile.PressureDifference = difference;
|
return;
|
||||||
tile.PressureDirection = (tile.GridIndices - other.GridIndices).GetDir().ToAtmosDirection();
|
|
||||||
}
|
tile.PressureDifference = difference;
|
||||||
|
tile.PressureDirection = differenceDirection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExperiencePressureDifference(
|
public void ExperiencePressureDifference(
|
||||||
|
|||||||
@@ -80,15 +80,16 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
{
|
{
|
||||||
var difference = Share(tile.Air!, enemyTile.Air!, adjacentTileLength);
|
var difference = Share(tile.Air!, enemyTile.Air!, adjacentTileLength);
|
||||||
|
|
||||||
if (SpaceWind)
|
// Monstermos already handles this, so let's not handle it ourselves.
|
||||||
|
if (!MonstermosEqualization)
|
||||||
{
|
{
|
||||||
if (difference > 0)
|
if (difference >= 0)
|
||||||
{
|
{
|
||||||
ConsiderPressureDifference(gridAtmosphere, tile, enemyTile, difference);
|
ConsiderPressureDifference(gridAtmosphere, tile, direction, difference);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ConsiderPressureDifference(gridAtmosphere, enemyTile, tile, -difference);
|
ConsiderPressureDifference(gridAtmosphere, enemyTile, direction.GetOpposite(), -difference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -547,18 +547,17 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
var amount = transferDirections[i];
|
var amount = transferDirections[i];
|
||||||
var otherTile = tile.AdjacentTiles[i];
|
var otherTile = tile.AdjacentTiles[i];
|
||||||
if (otherTile?.Air == null) continue;
|
if (otherTile?.Air == null) continue;
|
||||||
if (amount > 0)
|
if (amount <= 0) continue;
|
||||||
{
|
|
||||||
// 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;
|
// Everything that calls this method already ensures that Air will not be null.
|
||||||
Merge(otherTile.Air, tile.Air.Remove(amount));
|
if (tile.Air!.TotalMoles < amount)
|
||||||
InvalidateVisuals(tile.GridIndex, tile.GridIndices);
|
FinalizeEqNeighbors(gridAtmosphere, tile, transferDirections);
|
||||||
InvalidateVisuals(otherTile.GridIndex, otherTile.GridIndices);
|
|
||||||
ConsiderPressureDifference(gridAtmosphere, tile, otherTile, amount);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -219,6 +219,8 @@ namespace Content.Server.Atmos.EntitySystems
|
|||||||
if(!atmosphere.ProcessingPaused)
|
if(!atmosphere.ProcessingPaused)
|
||||||
atmosphere.CurrentRunTiles = new Queue<TileAtmosphere>(atmosphere.HighPressureDelta);
|
atmosphere.CurrentRunTiles = new Queue<TileAtmosphere>(atmosphere.HighPressureDelta);
|
||||||
|
|
||||||
|
// Note: This is still processed even if space wind is turned off since this handles playing the sounds.
|
||||||
|
|
||||||
var number = 0;
|
var number = 0;
|
||||||
var bodies = EntityManager.GetEntityQuery<PhysicsComponent>();
|
var bodies = EntityManager.GetEntityQuery<PhysicsComponent>();
|
||||||
var xforms = EntityManager.GetEntityQuery<TransformComponent>();
|
var xforms = EntityManager.GetEntityQuery<TransformComponent>();
|
||||||
|
|||||||
Reference in New Issue
Block a user