Merge remote-tracking branch 'upstream/master' into 20-10-30-admins

This commit is contained in:
Pieter-Jan Briers
2020-10-30 16:23:21 +01:00
747 changed files with 26214 additions and 11240 deletions

View File

@@ -65,6 +65,38 @@ namespace Content.Server.Atmos
}
}
/// <summary>
/// Heat capacity ratio of gas mixture
/// </summary>
[ViewVariables]
public float HeatCapacityRatio
{
get
{
var delimiterSum = 0f;
for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++)
{
delimiterSum += _moles[i] / (_atmosphereSystem.GetGas(i).HeatCapacityRatio - 1);
}
return 1 + TotalMoles / delimiterSum;
}
}
public float MolarMass
{
get
{
var molarMass = 0f;
var totalMoles = TotalMoles;
for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++)
{
molarMass += _atmosphereSystem.GetGas(i).MolarMass * (_moles[i] / totalMoles);
}
return molarMass;
}
}
[ViewVariables]
public float HeatCapacityArchived
{
@@ -136,14 +168,15 @@ namespace Content.Server.Atmos
public GasMixture(AtmosphereSystem? atmosphereSystem)
{
_atmosphereSystem = atmosphereSystem ?? EntitySystem.Get<AtmosphereSystem>();
_moles = new float[_atmosphereSystem.Gases.Count()];
_molesArchived = new float[_moles.Length];
}
public GasMixture(float volume, AtmosphereSystem? atmosphereSystem = null)
public GasMixture(float volume, AtmosphereSystem? atmosphereSystem = null): this(atmosphereSystem)
{
if (volume < 0)
volume = 0;
Volume = volume;
_atmosphereSystem = atmosphereSystem ?? EntitySystem.Get<AtmosphereSystem>();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]

View File

@@ -2,6 +2,7 @@
using System;
using Content.Server.GameObjects.Components.Atmos;
using Content.Shared.Atmos;
using Content.Shared.Physics;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.Interfaces.Physics;
using Robust.Shared.Interfaces.Random;
@@ -13,7 +14,7 @@ using Robust.Shared.Random;
namespace Content.Server.Atmos
{
public class HighPressureMovementController : VirtualController
public class HighPressureMovementController : FrictionController
{
[Dependency] private IRobustRandom _robustRandom = default!;
[Dependency] private IPhysicsManager _physicsManager = default!;
@@ -69,17 +70,5 @@ namespace Content.Server.Atmos
}
}
}
public override void UpdateAfterProcessing()
{
base.UpdateAfterProcessing();
if (ControlledComponent != null && !_physicsManager.IsWeightless(ControlledComponent.Owner.Transform.Coordinates))
{
LinearVelocity *= 0.85f;
if (MathF.Abs(LinearVelocity.Length) < 1f)
Stop();
}
}
}
}

View File

@@ -1127,6 +1127,10 @@ namespace Content.Server.Atmos
UpdateVisuals();
if (!Excited)
{
_gridAtmosphereComponent.AddActiveTile(this);
}
return true;
}