diff --git a/Content.IntegrationTests/Tests/Atmos/ConstantsTest.cs b/Content.IntegrationTests/Tests/Atmos/ConstantsTest.cs index dd14e1b333..6610e1d59f 100644 --- a/Content.IntegrationTests/Tests/Atmos/ConstantsTest.cs +++ b/Content.IntegrationTests/Tests/Atmos/ConstantsTest.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Content.Server.GameObjects.EntitySystems; using Content.Shared.Atmos; using NUnit.Framework; +using Robust.Shared.GameObjects.Systems; namespace Content.IntegrationTests.Tests.Atmos { @@ -18,10 +19,10 @@ namespace Content.IntegrationTests.Tests.Atmos await server.WaitIdleAsync(); - var atmosSystem = server.ResolveDependency(); - server.Post(() => { + var atmosSystem = EntitySystem.Get(); + Assert.That(atmosSystem.Gases.Count(), Is.EqualTo(Atmospherics.TotalNumberOfGases)); Assert.That(Enum.GetValues(typeof(Gas)).Length, Is.EqualTo(Atmospherics.TotalNumberOfGases)); diff --git a/Content.Server/GameObjects/Components/Atmos/GasMixtureHolderComponent.cs b/Content.Server/GameObjects/Components/Atmos/GasMixtureHolderComponent.cs index 5aeaff4fc9..5f2efb662a 100644 --- a/Content.Server/GameObjects/Components/Atmos/GasMixtureHolderComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/GasMixtureHolderComponent.cs @@ -10,12 +10,14 @@ namespace Content.Server.GameObjects.Components.Atmos { public override string Name => "GasMixtureHolder"; - [ViewVariables] public GasMixture GasMixture { get; set; } = new GasMixture(); + [ViewVariables] public GasMixture GasMixture { get; set; } public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); + GasMixture = new GasMixture(); + serializer.DataReadWriteFunction( "volume", 0f, diff --git a/Content.Server/GameObjects/Components/Body/Circulatory/BloodstreamComponent.cs b/Content.Server/GameObjects/Components/Body/Circulatory/BloodstreamComponent.cs index 9bf5f7e906..769a5e42c5 100644 --- a/Content.Server/GameObjects/Components/Body/Circulatory/BloodstreamComponent.cs +++ b/Content.Server/GameObjects/Components/Body/Circulatory/BloodstreamComponent.cs @@ -29,7 +29,7 @@ namespace Content.Server.GameObjects.Components.Body.Circulatory /// [ViewVariables] public ReagentUnit EmptyVolume => _internalSolution.EmptyVolume; - [ViewVariables] public GasMixture Air { get; set; } = new GasMixture(6); + [ViewVariables] public GasMixture Air { get; set; } [ViewVariables] public SolutionComponent Solution => _internalSolution; @@ -45,6 +45,8 @@ namespace Content.Server.GameObjects.Components.Body.Circulatory { base.ExposeData(serializer); + Air = new GasMixture(6); + serializer.DataField(ref _initialMaxVolume, "maxVolume", ReagentUnit.New(250)); } diff --git a/Content.Server/GameObjects/Components/Body/Respiratory/LungComponent.cs b/Content.Server/GameObjects/Components/Body/Respiratory/LungComponent.cs index eb625d7a64..1596b01c64 100644 --- a/Content.Server/GameObjects/Components/Body/Respiratory/LungComponent.cs +++ b/Content.Server/GameObjects/Components/Body/Respiratory/LungComponent.cs @@ -21,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Body.Respiratory /// [ViewVariables(VVAccess.ReadWrite)] private float Pressure { get; set; } - [ViewVariables] public GasMixture Air { get; set; } = new GasMixture(); + [ViewVariables] public GasMixture Air { get; set; } [ViewVariables] public LungStatus Status { get; set; } @@ -29,6 +29,8 @@ namespace Content.Server.GameObjects.Components.Body.Respiratory { base.ExposeData(serializer); + Air = new GasMixture(); + serializer.DataReadWriteFunction( "volume", 6,