Fix atmos NaN error (#26441)
* Fix atmos NAN error * Remove redundant yaml entries
This commit is contained in:
@@ -85,8 +85,6 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
private bool AirtightMove(Entity<AirtightComponent> ent, ref MoveEvent ev)
|
||||
{
|
||||
var (owner, airtight) = ent;
|
||||
if (!airtight.RotateAirBlocked || airtight.InitialAirBlockedDirection == (int)AtmosDirection.Invalid)
|
||||
return false;
|
||||
|
||||
airtight.CurrentAirBlockedDirection = (int) Rotate((AtmosDirection)airtight.InitialAirBlockedDirection, ev.NewRotation);
|
||||
var pos = airtight.LastPosition;
|
||||
|
||||
@@ -399,10 +399,7 @@ public sealed partial class AtmosphereSystem
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void GridFixTileVacuum(
|
||||
Entity<GridAtmosphereComponent, GasTileOverlayComponent, MapGridComponent, TransformComponent> ent,
|
||||
TileAtmosphere tile,
|
||||
float volume)
|
||||
private void GridFixTileVacuum(TileAtmosphere tile)
|
||||
{
|
||||
DebugTools.AssertNotNull(tile.Air);
|
||||
DebugTools.Assert(tile.Air?.Immutable == false );
|
||||
@@ -416,6 +413,9 @@ public sealed partial class AtmosphereSystem
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
var ratio = 1f / count;
|
||||
var totalTemperature = 0f;
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
tile.Air = new GasMixture(volume){Temperature = Atmospherics.T20C};
|
||||
|
||||
if (data.FixVacuum)
|
||||
GridFixTileVacuum(ent, tile, volume);
|
||||
GridFixTileVacuum(tile);
|
||||
}
|
||||
|
||||
private void QueueRunTiles(
|
||||
|
||||
@@ -78,12 +78,13 @@ public partial class AtmosphereSystem
|
||||
if (!_airtightQuery.TryGetComponent(ent, out var airtight))
|
||||
continue;
|
||||
|
||||
fixVacuum |= airtight.FixVacuum;
|
||||
|
||||
if(!airtight.AirBlocked)
|
||||
continue;
|
||||
|
||||
blockedDirs |= airtight.AirBlockedDirection;
|
||||
noAirWhenBlocked |= airtight.NoAirWhenFullyAirBlocked;
|
||||
fixVacuum |= airtight.FixVacuum;
|
||||
|
||||
if (blockedDirs == AtmosDirection.All && noAirWhenBlocked && fixVacuum)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user