Update CloseTo to CloseToPercent (#4708)

This commit is contained in:
metalgearsloth
2021-09-29 20:07:01 +10:00
committed by GitHub
parent fe4a415d3b
commit ad783396f8
18 changed files with 31 additions and 31 deletions

View File

@@ -37,7 +37,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
var outputStartingPressure = outlet.Air.Pressure;
if (MathHelper.CloseTo(pump.TargetPressure, outputStartingPressure))
if (MathHelper.CloseToPercent(pump.TargetPressure, outputStartingPressure))
{
appearance?.SetData(PressurePumpVisuals.Enabled, false);
return; // No need to pump gas if target has been reached.

View File

@@ -186,7 +186,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
DirtyUI(uid, canister, nodeContainer, containerManager);
// If last pressure is very close to the current pressure, do nothing.
if (MathHelper.CloseTo(canister.Air.Pressure, canister.LastPressure))
if (MathHelper.CloseToPercent(canister.Air.Pressure, canister.LastPressure))
return;
canister.LastPressure = canister.Air.Pressure;

View File

@@ -85,7 +85,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
var removed = tile.Remove(transferMoles);
// Nothing left to remove from the tile.
if (MathHelper.CloseTo(removed.TotalMoles, 0f))
if (MathHelper.CloseToPercent(removed.TotalMoles, 0f))
return;
atmosphereSystem.ScrubInto(removed, outlet.Air, scrubber.FilterGases);