Gas moles may never be below the minimum amount of moles again.

A few atmos tweaks and fixes. Should(?) fix the NaN issue that can't be replicated.
This commit is contained in:
Víctor Aguilera Puerto
2020-11-26 12:39:13 +01:00
parent e21356ad93
commit 4b77f27e77
2 changed files with 31 additions and 11 deletions

View File

@@ -1,10 +1,17 @@
namespace Content.Shared.Atmos
using Robust.Shared.Maths;
namespace Content.Shared.Atmos
{
/// <summary>
/// Class to store atmos constants.
/// </summary>
public class Atmospherics
public static class Atmospherics
{
static Atmospherics()
{
AdjustedNumberOfGases = MathHelper.NextMultipleOf(TotalNumberOfGases, 4);
}
#region ATMOS
/// <summary>
/// The universal gas constant, in kPa*L/(K*mol)
@@ -144,7 +151,13 @@
/// <summary>
/// Total number of gases. Increase this if you want to add more!
/// </summary>
public const byte TotalNumberOfGases = 6;
public const int TotalNumberOfGases = 6;
/// <summary>
/// This is the actual length of the gases arrays in mixtures.
/// Set to the closest multiple of 4 relative to <see cref="TotalNumberOfGases"/> for SIMD reasons.
/// </summary>
public static readonly int AdjustedNumberOfGases;
/// <summary>
/// Amount of heat released per mole of burnt hydrogen or tritium (hydrogen isotope)