From cb15ef8ebcd49043302366cc53b5afc66a9edd14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Fri, 11 Sep 2020 12:52:40 +0200 Subject: [PATCH] Fix atmos bug with gasmixture serialization --- Content.Server/Atmos/GasMixture.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Content.Server/Atmos/GasMixture.cs b/Content.Server/Atmos/GasMixture.cs index ddd834eceb..54bb5ad47c 100644 --- a/Content.Server/Atmos/GasMixture.cs +++ b/Content.Server/Atmos/GasMixture.cs @@ -545,6 +545,10 @@ namespace Content.Server.Atmos serializer.DataField(ref _moles, "moles", new float[Atmospherics.TotalNumberOfGases]); serializer.DataField(ref _molesArchived, "molesArchived", new float[Atmospherics.TotalNumberOfGases]); serializer.DataField(ref _temperature, "temperature", Atmospherics.TCMB); + + // The arrays MUST have a specific length. + Array.Resize(ref _moles, Atmospherics.TotalNumberOfGases); + Array.Resize(ref _molesArchived, Atmospherics.TotalNumberOfGases); } public override bool Equals(object? obj)