From 1fc941b3b38442659e12206f51da0e8b5d0ac925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Wed, 12 Aug 2020 19:37:07 +0200 Subject: [PATCH] Removes CannyFastMath usage from Atmos. --- Content.Server/Atmos/GasMixture.cs | 2 -- Content.Server/Atmos/HighPressureMovementController.cs | 7 +++---- Content.Server/Atmos/Reactions/PhoronFireReaction.cs | 2 +- Content.Server/Atmos/TileAtmosphere.cs | 6 ++---- .../GameObjects/Components/Atmos/BarotraumaComponent.cs | 4 ++-- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Content.Server/Atmos/GasMixture.cs b/Content.Server/Atmos/GasMixture.cs index a500e831b1..1455402779 100644 --- a/Content.Server/Atmos/GasMixture.cs +++ b/Content.Server/Atmos/GasMixture.cs @@ -11,8 +11,6 @@ using Robust.Shared.IoC; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; -using Math = CannyFastMath.Math; -using MathF = CannyFastMath.MathF; namespace Content.Server.Atmos { diff --git a/Content.Server/Atmos/HighPressureMovementController.cs b/Content.Server/Atmos/HighPressureMovementController.cs index b7644151d4..d3d8a93d48 100644 --- a/Content.Server/Atmos/HighPressureMovementController.cs +++ b/Content.Server/Atmos/HighPressureMovementController.cs @@ -1,4 +1,5 @@ #nullable enable +using System; using Content.Server.GameObjects.Components.Atmos; using Robust.Shared.GameObjects.Components; using Robust.Shared.Interfaces.Physics; @@ -8,8 +9,6 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Random; -using Logger = Robust.Shared.Log.Logger; -using MathF = CannyFastMath.MathF; namespace Content.Server.Atmos { @@ -52,13 +51,13 @@ namespace Content.Server.Atmos if (maxForce > ThrowForce && throwTarget != GridCoordinates.InvalidGrid) { - var moveForce = MathF.Min(maxForce * MathF.Clamp(moveProb, 0, 100) / 100f, 50f); + var moveForce = MathF.Min(maxForce * Math.Clamp(moveProb, 0, 100) / 100f, 50f); var pos = throwTarget.Position - transform.GridPosition.Position; LinearVelocity = pos * moveForce; } else { - var moveForce = MathF.Min(maxForce * MathF.Clamp(moveProb, 0, 100) / 100f, 25f); + var moveForce = MathF.Min(maxForce * Math.Clamp(moveProb, 0, 100) / 100f, 25f); LinearVelocity = direction.ToVec() * moveForce; } diff --git a/Content.Server/Atmos/Reactions/PhoronFireReaction.cs b/Content.Server/Atmos/Reactions/PhoronFireReaction.cs index f67752f906..4b9d05e90f 100644 --- a/Content.Server/Atmos/Reactions/PhoronFireReaction.cs +++ b/Content.Server/Atmos/Reactions/PhoronFireReaction.cs @@ -1,5 +1,5 @@ #nullable enable -using CannyFastMath; +using System; using Content.Server.Interfaces; using Content.Shared.Atmos; using JetBrains.Annotations; diff --git a/Content.Server/Atmos/TileAtmosphere.cs b/Content.Server/Atmos/TileAtmosphere.cs index f709f8e9de..f0c7cc458b 100644 --- a/Content.Server/Atmos/TileAtmosphere.cs +++ b/Content.Server/Atmos/TileAtmosphere.cs @@ -18,8 +18,6 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Random; using Robust.Shared.ViewVariables; -using Logger = Robust.Shared.Log.Logger; -using MathF = CannyFastMath.MathF; namespace Content.Server.Atmos { @@ -140,7 +138,7 @@ namespace Content.Server.Atmos { if(_soundCooldown == 0) EntitySystem.Get().PlayAtCoords("/Audio/Effects/space_wind.ogg", - GridIndices.ToGridCoordinates(_mapManager, GridIndex), AudioHelpers.WithVariation(0.125f).WithVolume(MathF.Clamp(PressureDifference / 10, 10, 100))); + GridIndices.ToGridCoordinates(_mapManager, GridIndex), AudioHelpers.WithVariation(0.125f).WithVolume(Math.Clamp(PressureDifference / 10, 10, 100))); } @@ -812,7 +810,7 @@ namespace Content.Server.Atmos private void HandleDecompressionFloorRip(float sum) { - if (sum > 20 && _robustRandom.Prob(MathF.Clamp(sum / 100, 0.005f, 0.5f))) + if (sum > 20 && _robustRandom.Prob(Math.Clamp(sum / 100, 0.005f, 0.5f))) _gridAtmosphereComponent.PryTile(GridIndices); } diff --git a/Content.Server/GameObjects/Components/Atmos/BarotraumaComponent.cs b/Content.Server/GameObjects/Components/Atmos/BarotraumaComponent.cs index 0f35468ae7..cd2066d99c 100644 --- a/Content.Server/GameObjects/Components/Atmos/BarotraumaComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/BarotraumaComponent.cs @@ -1,5 +1,5 @@ -using System.Runtime.CompilerServices; -using CannyFastMath; +using System; +using System.Runtime.CompilerServices; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.GameObjects;